Created
December 13, 2019 14:39
-
-
Save RobsonAutomator/00308655a9ed8b51fcc2ac0bd4ec7fc6 to your computer and use it in GitHub Desktop.
Setup default content language in Sitecore for Content Author
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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