是否有任何等效的PowerShell:

Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

?还是如何独立于机器配置来强制所有串扰服从文化?

最佳答案

我认为这会起作用:

$currentThread = [System.Threading.Thread]::CurrentThread
$culture = [System.Globalization.CultureInfo]::InvariantCulture
$currentThread.CurrentCulture = $culture
$currentThread.CurrentUICulture = $culture

这个想法来自:

http://blogs.msdn.com/b/powershell/archive/2006/04/25/583235.aspx

关于.net - 如何在PowerShell中设置区域性?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4105224/

10-09 00:00