9

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.

1
  • 4
    Changing user locale does not affect already started PowerShell instances. You have to start new PowerShell process, so it pickup new value. Dec 14, 2015 at 5:39

2 Answers 2

8

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:

enter image description here

Hope this helps!

6
  • If you were to run the PowerShell script in the Azure Cloud Service web role, I would recommend to add #Requires -RunAsAdministrator in your PowerShell script to make sure your PowerShell will have the elevated privilege to set culture
    – juvchan
    Dec 14, 2015 at 12:17
  • If the above able to resolve your issue, I will edit my answer.
    – juvchan
    Dec 14, 2015 at 12:17
  • What is the status of this issue? Is anymore support needed?
    – juvchan
    Dec 17, 2015 at 5:18
  • your answer was correct. So as far as I understand, I should always run powershell ISE as administrator?
    – RuSs
    Dec 17, 2015 at 19:57
  • @RuSs, thanks for your feedback. Yes I would recommend that if you intend to modify system settings
    – juvchan
    Dec 17, 2015 at 21:14
5

Like petseral said in a comment above:

Changing user locale does not affect already started PowerShell instances.
You have to start new PowerShell process.

1
  • This is exactly the answer for me
    – Beingnin
    Nov 26, 2019 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.