一个Powershell命令是如何在远程计算机上工作的,而另一个却不是来自同一个控制台的呢?
- Get-Counter '\Paging File(\*)\% Usage' -ComputerName win8
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidResult: (:) [Get-Counter], Exception
- FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.GetCount erCommand
发布于 2013-09-19 07:35:10
获取服务和获取计数器为-ComputerName使用了不同的远程处理层.调用-命令-ComputerName使用WinRM远程处理层,Get(我相信)是一个远程注册表调用。柜台是DCOM电话,我相信是通过WMI。
如果您不知道包含-ComputerName的cmdlet使用的是PowerShell远程处理层,这是一个很好的经验规则,它可能不是。许多cmdlet在V1 of PowerShell中使用了PowerShell,许多其他远程处理层比WinRM更高效,因此许多-ComputerName参数使用自己的层。
https://stackoverflow.com/questions/18882901
复制相似问题