PowerShell - Set-Culture doesn't seem to change anything

百般思念 提交于 2020-07-03 06:12:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!