Skip to main content

Posts

Showing posts with the label Update dictionaries using a CSV file

Sitecore Power Shell Scripts

Export dictionaries into a CSV file Here we can see how to export the dictionaries data, key and phrases, into a csv file using a power shell script.  $DataPath = "Give the path of Csv file to export dictionaries data" $allItems = Get-ChildItem -Path 'master:Give the path of dictionaries parent item' -Recurse $Results = @() ForEach ($item in $allItems) {  if($item.TemplateName -eq "Dictionary Entry")    {  $LangItem = Get-Item -Path $item.FullPath -Language "Give the language code in case of secondary language data is needed. For example nl for Dutch language     $Properties = @{  ItemName = $item.Name   Key = $item["Key"]    EnglishPhrase = $item["Phrase"]  }    if($LangItem -ne $null) {        $Properties.Add("LangPhrase", $LangItem["Phrase"])   }    $Results += New-Object psobject -Property $Properties  } } $Results | Select-Object ItemName, Key, EnglishPhrase, LangPhras...