stop-service -inputobject 后面跟获取对象的命令出现错误


PowerShell交流中心 › 分类: Powershell基础 › stop-service -inputobject 后面跟获取对象的命令出现错误
0 赞 踩
TAO_Powershell asked 10 年 ago

stop-service -inputobject后面可以输入一个包含对象的变量或输入获取对象的命令或表达式。
我测试发现inputobject后面可以跟变量,但是输入命令或表达式就不行,是不是我输入的不对?请给解释下,谢谢。
如:stop-service -inputobject get-service -whatif

1 Answers
1 赞 踩
Best Answer
Mooser Lee 管理员 answered 10 年 ago
Stop-Service -InputObject( Get-Service) -WhatIf
TAO_Powershell replied 10 年 ago

非常感谢!