I have a Cloud Service Web Role that I need to run some PowerShell on to ensure the server is always setup in the right culture: en-AU.
The reason for this is that Microsoft could, at anytime, reset the culture values.
When I run:
Get-Culture
I get:
1033 en-US English (United States)
So then I run:
Set-Culture en-AU
But I still get:
1033 en-US English (United States)
I have tried many things but nothing seems to really change the culture.
Any help would be great.
The Set-Culture cmdlet sets a specific culture for the current user account. A culture is known as a locale for unmanaged code development. The information includes the names for the culture, the writing system, the calendar, and formatting for dates and sort strings.
You can assign to [cultureinfo]::CurrentUICulture / [cultureinfo]::CurrentCulture to change the UI culture / culture for the current thread (only, non-persistently); e.g., the following command outputs the current date and time using the French culture: [cultureinfo]::CurrentCulture = 'fr-FR'; Get-Date.
Description. The Get-Culture cmdlet gets information about the current culture settings. This includes information about the current language settings on the system, such as the keyboard layout, and the display format of items such as numbers, currency, and dates.
The PowerShell Set-Item cmdlet changes the value of an item to the value specified in the command. It changes the value of a variable or registry key. The Windows PowerShell FileSystem provider does not support this cmdlet.
The root cause is because you are not running the PowerShell with Administrator privilege.
Set-Culture
needs Administrator privilege to be set on the system.
Just run your PowerShell in Administrator mode and your culture will be set to the new one as below:
Hope this helps!
Like petseral said in a comment above:
Changing user locale does not affect already started PowerShell instances.
You have to start new PowerShell process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With