问题
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:
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!
回答2:
Like petseral said in a comment above:
Changing user locale does not affect already started PowerShell instances.
You have to start new PowerShell process.
来源:https://stackoverflow.com/questions/34260245/powershell-set-culture-doesnt-seem-to-change-anything