Set-Service -Status Stopped not only prevents stopping services that other services depend on (.DependentServices), but, curiously, also services that themselves depend on others (.ServicesDependedOn.
For instance, the wuauserv service has no dependents, but itself depends on the rpcss service.
As an aside: Set-Service -Status Stopped lacks a -Force switch that would allow it to stop dependent services too, the way Stop-Service offers.
Steps to reproduce
Set-Service -Status Stopped wuauserv
Expected behavior
Given that the service has no dependents, it should be stopped.
Actual behavior
The following error occurs:
Set-Service : Cannot stop service 'Windows Update (wuauserv)' because it is dependent on other services.
...
That the service depends on other services shouldn't prevent its stopping.
Environment data
PowerShell Core 6.0.0-rc on on Microsoft Windows 7 Enterprise (64-bit; v6.1.7601)
Windows PowerShell v5.1.14409.1012 on Microsoft Windows 7 Enterprise (64-bit; v6.1.7601)
Set-Service -Status Stoppednot only prevents stopping services that other services depend on (.DependentServices), but, curiously, also services that themselves depend on others (.ServicesDependedOn.For instance, the
wuauservservice has no dependents, but itself depends on therpcssservice.As an aside:
Set-Service -Status Stoppedlacks a-Forceswitch that would allow it to stop dependent services too, the wayStop-Serviceoffers.Steps to reproduce
Expected behavior
Given that the service has no dependents, it should be stopped.
Actual behavior
The following error occurs:
That the service depends on other services shouldn't prevent its stopping.
Environment data