0

尝试加载 pscx PowerShell 模块时出现以下错误。

Import-Module : The following error occurred while loading the extended type data file: Error in TypeData "System.TimeSpan": Type "Pscx.TypeConverters.WmiDateTimeTypeConverter" should be either TypeConverter or PSTypeConverter. Error in TypeData "System.DateTime": Type "Pscx.TypeConverters.WmiDateTimeTypeConverter" should be either TypeConverter or PSTypeConverter. At C:\Users\<username>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:1 char:1
+ Import-Module pscx
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

任何想法为什么我会收到此错误。几周前我将 Windows 更新到最新的 Windows 10 更新后,它似乎就开始发生了。

以下是 PowerShell 版本详细信息:

Name                           Value
----                           -----
PSVersion                      5.1.17134.228
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.228
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

我已经使用 DotPeek 检查了 dll,并且 Pscx.TypeConverters.WmiDateTimeTypeConverter 类型确实继承自 PSTypeConverter。

4

0 回答 0