如何从PowerShell中的Invoke-Command输出中排除PSComputerName属性?
当我们使用Invoke-Command时,我们在输出表中获得PSComputerName额外字段。您可以使用-HideComputerName参数将其删除。例如,以下命令为输出提供PSComputerName属性。
示例
Invoke-Command -ComputerName LabMachine2k12 -ScriptBlock{Get-Service Winrm} | ft -AutoSize输出结果Status Name DisplayName PSComputerName ------ ---- ----------- -------------- Running Winrm Windows Remote Management (WS-Management) LabMachine2k12
要隐藏PSComputerName属性,
示例
Invoke-Command -ComputerName LabMachine2k12 -ScriptBlock{Get-Service Winrm} -HideComputerName输出结果Status Name DisplayName ------ ---- ----------- Running Winrm Windows Remote Management (WS-Management)
热门推荐
10 祝孙辈生日祝福语简短
11 恋人跨年祝福语大全简短
12 考大学敬酒简短祝福语
13 开工投产大吉祝福语 简短
14 偶然结婚祝福语朋友简短
15 感谢学长学姐祝福语简短
16 戏精的祝福语简短
17 我要结婚祝福语简短
18 婚前女儿生日祝福语简短