0
votes

I have English version items in my site which has korean versions(with korean content) also. Here i am trying to copy the English field value of the 'Download Type'(template field) to the same item in the Korean version. i am new to sitecore powershell, i was trying to modify the below code which is fething field value of english items

Get-ChildItem master:"/sitecore/sitePath/itemsTobeModified" -Language "en" -Recurse |
    ForEach-Object { 
    $_.Editing.BeginEdit() 
    $_["Download Type"]
    $_.Editing.EndEdit() | Out-Null   
  }

Can anyone help me to modify this? Thanks in advance!!

1

1 Answers

2
votes

You need to get the item in Korean and then update the korean version field value with the english version field value. Here is a sample for that, replace the path and field name this should work fine

Get-ChildItem master:"/sitecore/content/Home" -Language "en" -Recurse |
ForEach-Object {
$item =  Get-Item $_.Id
$itemko = Get-Item $_.Id -lang "ko-KR"
$itemko.Editing.BeginEdit() 
$itemko["Title"] = $item["Title"]
$itemko.Editing.EndEdit() | Out-Null }