[Powershell] 一句代码获取服务的可执行程序路径

以ssh服务为例

Get-WmiObject win32_service | ?{$_.Name -like 'ssh*'} | select DisplayName, PathName

你可能感兴趣的:(powershell)