小编Var*_*asa的帖子

如何使用Get-Service命令提取Windows服务的物理路径

我需要在Win 2k8上运行的一组服务器上提取所有Windows服务的物理执行路径.因为,这个操作系统附带的powershell版本是2.0,我想使用Get-service命令而不是Get-WmiObject.我知道我可以使用下面给出的命令拉出物理路径

$QueryApp = "Select * from Win32_Service Where Name='AxInstSV'"
$Path = (Get-WmiObject -ComputerName MyServer -Query $QueryApp).PathName
Run Code Online (Sandbox Code Playgroud)

我不希望这个命令拉出物理路径但是想使用PS Version 2.0附带的Get-Service命令.

任何帮助将非常感激.

windows powershell windows-services powershell-2.0

8
推荐指数
1
解决办法
2万
查看次数