无法找到类型 [cultureinfo]
Unable to find type [cultureinfo]
我有 powershell v2。我遇到错误。
Unable to find type [cultureinfo]: make sure that the assembly containing this type is loaded.
有人以前遇到过这个错误吗?我的脚本在 powershell v3 上运行良好,但在我的服务器上它是 PS v2,我无法升级它。
这是我的命令运行。
$log_date = [datetime]::ParseExact('Tue Aug 4 17:05:41 2015','ddd MMM d HH:mm:ss yyyy',[cultureinfo]::InvariantCulture,'AllowInnerWhite')
PowerShell 对类型名称的搜索中仅包含少数命名空间(并且列表会随着版本的不同而扩展)。
和System.Globalization
(which contains CultureInfo
)不是一个。
但是名称的解析是相对于 PowerShell 默认的命名空间的,所以你可以使用 [Globalization.CultureInfo]
.
我有 powershell v2。我遇到错误。
Unable to find type [cultureinfo]: make sure that the assembly containing this type is loaded.
有人以前遇到过这个错误吗?我的脚本在 powershell v3 上运行良好,但在我的服务器上它是 PS v2,我无法升级它。
这是我的命令运行。
$log_date = [datetime]::ParseExact('Tue Aug 4 17:05:41 2015','ddd MMM d HH:mm:ss yyyy',[cultureinfo]::InvariantCulture,'AllowInnerWhite')
PowerShell 对类型名称的搜索中仅包含少数命名空间(并且列表会随着版本的不同而扩展)。
和System.Globalization
(which contains CultureInfo
)不是一个。
但是名称的解析是相对于 PowerShell 默认的命名空间的,所以你可以使用 [Globalization.CultureInfo]
.