powershell:改变当前会话的文化
我在 windows vista 上使用 powershell。 如何改变当前会话的文化? 我的计算机的文化是 tr-TR,所以我收到土耳其语的错误消息。我想改成EN?
有机会吗?
I am using powershell on windows vista.
How do I change the culture of current session?
My computer's culture is tr-TR so I am getting the error messages on Turkish. I would like to change to EN?
any chance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请查看此处:http://blogs.msdn。 com/b/powershell/archive/2006/04/25/583235.aspx
和此处:http://poshcode.org/2226:
其他信息
要查找哪些值可用于
$culture
:这将为您提供文化类型列表:
选择上述类型之一(例如 AllCultures),然后您可以列出该类型的可用值:
然后您可以将您感兴趣的文化的名称或编号与
GetCultureInfo
方法来检索您想要的值:注意:感谢隐式转换,您可以将区域性名称或数字(即作为字符串或整数)传递给 Set-Culture 方法,该方法会自动转换为预期的 CultureInfo 值。
Have a look here: http://blogs.msdn.com/b/powershell/archive/2006/04/25/583235.aspx
and here: http://poshcode.org/2226:
Additional Info
To find which values can be used for
$culture
:This will give you a list of Culture Types:
Selecting one of the above types (e.g. AllCultures) you can then list the available values of that type:
You can then use the Name or Number of the culture you're interested in with the
GetCultureInfo
method to retrieve the value you're after:NB: Thanks to implicit conversion, you could just pass the culture name or number (i.e. as a string or integer) to the
Set-Culture
method which would automatically be converted to the expected CultureInfo value.由于 @manojlds 接受的解决方案实际上不起作用(Windows 10 上的 PS 5.1),这里对我有用的解决方案(在
As the accepted solution by @manojlds actually doesn't work (PS 5.1 on Windows 10) here what works for me (found on github):