Search notes:

set-service

Stopping a service

It is possible to stop a service by assigning the stopped status to the service:
PS C:\> set-service MySQL80 -status stopped
However, if a service has dependent services, such as MSSQLSERVER, an error is thrown:
PS C:\> set-service MSSQLSERVER -status stopped
set-service : Cannot stop service 'SQL Server (MSSQLSERVER) (MSSQLSERVER)' because it has dependent services.
…
Such service can be stopped with the better suited cmdLet stop-service:
PS C:\> stop-service MSSQLSERVER

See also

The command parameter -credential.
Powershell command noun: service

Index