初始化名称空间管理器时,收到一条错误消息,提示未找到构造函数。
我正在尝试运行$XmlNSManager = New-Object System.Xml.XmlNamespaceManager -ArgumentList $xml.NameTable
并收到以下错误消息:
New-Object : A constructor was not found. Cannot find an appropriate constructor for type System.Xml.XmlNamespaceManager.
At line:1 char:17
+ ... NSManager = New-Object System.Xml.XmlNamespaceManager -ArgumentList $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand
$XmlNSManager = New-Object System.Xml.XmlNamespaceManager -ArgumentList $xml.NameTable