Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup default content language in Sitecore for Content Author
# Author: Robert Senktas vel @RobsonAutomator
# Scritp to use with Sitecore PowerShell Extension
$user = Get-User -Identity $me -Authenticated
$options = [ordered]@{};
$languages = Get-ChildItem -Path 'master:/sitecore/system/Languages/'
foreach( $language in $languages )
{
$options.Add($language.Name, $language.Name);
}
$language = $user.Profile.ContentLanguage
Write-Host "Current ContentLanguage $language"
$dialog = Read-Variable -Parameters `
@{ Name = "language"; Title="Choose Language"; Options=$options;} `
-Description "This script will set default content language." `
-Width 400 -Height 200 `
-Title "Content language Toolbox" `
-OkButtonName "OK" `
-CancelButtonName "Cancel"
if ($dialog -ne "ok")
{
Exit
}
$user.Profile.ContentLanguage = $language
Write-Host "New ContentLanguage $language"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.