Question:
I am new to Powershell and I have searched the internet for whole day but still cannot find out how to customize “Region and Language” settings using Powershell in win7 or win2008.
I want to change the following settings within Powershell:
- Current System Locale
- Short Date and Long Date format
- Short Time and Long Time format
- Current Location
Anybody knows how to do that using Powershell? Cmd/Bat/.NET solutions also welcome!
Answer:
I know your question was about Windows 7; this information may be helpful for those now running newer versions. Set-WinUserLanguageList
, New-WinUserLanguageList
and Get-WinUserLanguageList
in Windows 8 and up let you control the installed languages. For example to add a language:
1 2 3 4 |
$list = Get-WinUserLanguageList $list.Add("fr-FR") Set-WinUserLanguageList $list |
Set-Culture
in PowerShell 3 lets you change culture, for example to choose defaults for Germany:
1 2 |
Set-Culture de-DE |
Or, to set custom formats:
1 2 3 4 5 6 7 |
$culture = Get-Culture $culture.DateTimeFormat.ShortDatePattern = 'yyyy-MM-dd' $culture.DateTimeFormat.LongDatePattern = 'dddd, d MMMM yyyy' $culture.DateTimeFormat.ShortTimePattern = 'h:mm tt' $culture.DateTimeFormat.LongTimePattern = 'h:mm:ss tt' Set-Culture $culture |
To change the location, use Set-WinHomeLocation
, for example to set the user’s location to Austria:
1 2 |
Set-WinHomeLocation -GeoId 14 |
MSDN has a list of GeoIds and a TechNet has a reference for international settings cmdlets.