How to get all language versions of Sitecore?

How to get all language versions of Sitecore?

The script below returns a list with the names of languages which have versions for the item. 0.7298ms to get Version Counts with 8 language versions. Time to load item: 9.3041ms. Langs: es-ES, es-MX, sv-SE, en, it-IT, pt-BR, fr-FR, de-DE 0.0448ms to get Version Counts with 7 language versions.

When to throw an error in Sitecore PowerShell?

Throws an error if the item does not exist. Use when Sitecore query: or fast: is required. May return more than 1 item. Use to return an item’s children and grandchildren. Use to create an item based on a specified data template. Use to delete or recycle an item.

How to edit an item in Sitecore PowerShell?

Subsequently call the $item [“field name\\ = “new value” for each property modify. Finally end with the $item.Editing.EndEdit (). Choosing this way is situational and will usually only be required if you’re working with a large volume of data. In those cases you might also want to introduce the Sitecore.Data.BulkUpdateContext technique.

When to use before and after paths in Sitecore?

Important to note that the query format sometimes requires the use of a # before and after paths when they contain reserved keywords or spaces. Workaround found here on Sitecore Stack Exchange. Example: The following retrieves all items beneath the path /sitecore/content/ with the template of Sample Item.

How to create new version of item, in different language?

In your code, I can see that you are trying to add a new version of the item in the context language, as opposed to the language of the actual item. Remember that each instance of a Sitecore item is actually only a single language version of the item. Don’t believe me?

How to check versioncount of returned items in Sitecore?

You need to check the versioncount of the returned items. There are probably better ways to achieve this, but following your own code example, it would look something like this: