我很less使用PowerShell,但我想使用Set-DnsClientServerAddress 。 直接运行告诉我,我需要导入模块DnsClient。 当我运行Import-Module DnsClient我得到下面的输出。 这是怎么回事? 我当然一直没有搞乱这些Windows文件。 我在Windows 8上运行PS v4。
PS C:\> Import-Module DnsClient VERBOSE: Loading module from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsClient.psd1'. VERBOSE: Loading 'TypesToProcess' from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsCmdlets.Types.ps1xml'. VERBOSE: Loading 'TypesToProcess' from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsConfig.Types.ps1xml'. VERBOSE: Loading 'TypesToProcess' from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsClientPSProvider.Types.ps1xml'. VERBOSE: Loading 'FormatsToProcess' from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsCmdlets.Format.ps1xml'. VERBOSE: Loading 'FormatsToProcess' from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsConfig.Format.ps1xml'. VERBOSE: Loading 'FormatsToProcess' from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\DnsClientPSProvider.Format.ps1xml'. VERBOSE: Loading module from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\dnslookup.dll'. VERBOSE: Importing cmdlet 'Resolve-DnsName'. VERBOSE: Loading module from path 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\MSFT_DnsClient.cdxml'. Import-Module : Cannot process Cmdlet Definition XML for the following file: C:\windows\system32\WindowsPowerShell\v1.0\Modules\DnsClient\MSFT_DnsClient.cdxml. At line:374 char:13 + $__cmdletization_exceptionHasBeenThrown = $true + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Executable script code found in signature block. At line:375 char:13 + throw + ~~~~~ Executable script code found in signature block. At line:380 char:9 + $__cmdletization_exceptionHasBeenThrown = $false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Executable script code found in signature block. At line:383 char:13 + __cmdletization_BindCommonParameters $__cmdletization_objectModelWra ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Executable script code found in signature block. At line:384 char:13 + $__cmdletization_objectModelWrapper.BeginProcessing() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Executable script code found in signature block. At line:388 char:13 + $__cmdletization_exceptionHasBeenThrown = $true + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Executable script code found in signature block. At line:389 char:13 + throw + ~~~~~ Executable script code found in signature block. At line:381 char:9 + try + ~~~ Executable script code found in signature block. At line:399 char:5 + $__cmdletization_queryBuilder = $__cmdletization_objectModelWrapper.GetQuery ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Executable script code found in signature block. At line:400 char:66 + if ($PSBoundParameters.ContainsKey('InterfaceIndex') -and (@('ByName') -cont ... + ~~~~~~~~ Executable script code found in signature block. Not all parse errors were reported. Correct the reported errors and try again. At line:1 char:1 + Import-Module DnsClient + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Import-Module], XmlException + FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.PowerShell.Commands.ImportModuleCommand PS C:\>