Create language version of all items under path

992 Views Asked by At

I have a ton of items that I need to create a French language version for, and I'd like to use SPE to do this rather than going through manually adding a language version for hundreds of items. I'm running this command in PowerShell console:

Get-ChildItem /sitecore/content/Global/Components/Web Forms/Country -Recurse |
    Where-Object { $_.TemplateName -eq "CountryLookup" } | 
    ForEach-Object { Add-ItemLanguage $_ -Language "en" -TargetLanguage "fr" -IfExist Skip}

When I run it, it doesn't return any errors or give me any output, and when I check the items under /sitecore/content/Global/Components/Web Forms/Country there are still no French versions. What's wrong with my PowerShell command?

1

There are 1 best solutions below

0
Njara Liantsoa On

Can you try with this by using Add-ItemVersion and "fr-FR" as target language.

Add-ItemVersion  $_ -Language "en" -TargetLanguage "fr-FR" -IfExist Skip