Eu raramente uso o PowerShell, mas queria usar Set-DnsClientServerAddress
. Executá-lo diretamente me diz que eu preciso importar o módulo DnsClient. Quando eu executo Import-Module DnsClient
, obtenho a saída abaixo. O que está acontecendo? Eu certamente não tenho mexido com esses arquivos do Windows. Estou executando o PS v4 no Windows 8.
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:\>
Tags powershell