是否可以使用 powershell 添加 Windows 服务依赖项?

Ska*_*aue 4 powershell service

我知道有这个sc.exe,您可以在其中添加和设置 Windows 服务依赖项,但我想知道是否可以使用 Powershell 完成同样的事情。

Ric*_*ard 5

来自文档:不是通过Set-Servicecmdlet。

但是ChangeWin32_Service允许指定依赖项的方法:因此 WMI 可以做到。