PowerShell 中的 CurrentCulture 和 CurrentUICulture


在自动化变量$Host中有两个属性:CurrentCulture和CurrentUICulture

PS > $Host.CurrentCulture

LCID             Name             DisplayName
----             ----             -----------
2057             en-GB            English (United Kingdom)

PS > $Host.CurrentUICulture

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

 

我个人关于CurrentCulture和CurrentUICulture的理解:

  • CurrentCulture是操作系统的区域设置,这些设置可以影响排序,日期,货币等的显示与转换。
  • CurrentUICulture是软件在用户界面上显示设置。(例如你安装了office2013默认是英文的,自然CurrentUICulture为英文,当你安装了office 2013中文语言包后,并且设置了中文显示时,则CurrentUICulture为中文。)

在PowerShell中CurrentCulture由系统的locale决定(可以在控制面板中更改),但是CurrentUICulture则由你当前系统中安装的powershell 本地化版本决定。

本文链接: https://www.pstips.net/diff-with-currentculture-and-currentuiculture.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

关于 Mooser Lee

我是一个Powershell的爱好者,创建了PowerShell中文博客,热衷于Powershell技术的搜集和分享。本站部分内容来源于互联网,不足之处敬请谅解,并欢迎您批评指正。

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注