Forrest logo
back to the Stop-Service tool

stop-service:tldr:1a0be

stop-service: Stop a service by using the display name.
$ Stop-Service -DisplayName "${name}"
try on your machine

The command "Stop-Service -DisplayName "${name}"" is a PowerShell command that stops a running service on a Windows operating system.

Here is the breakdown of the command:

  • "Stop-Service": This is the main command that instructs PowerShell to stop a service.
  • "-DisplayName": This is a parameter that followed by the name of the service displayed in the services list, rather than its actual service name. The "-DisplayName" parameter makes it more user-friendly by referring to the service by its display name instead of the actual service name.
  • "${name}": This is a placeholder for the actual display name of the service. It is surrounded by double quotes to enforce it as a string. The value of "${name}" needs to be replaced with the desired service display name before executing the command.

To use the command, one would replace "${name}" with the actual display name of the service they want to stop. For example, if the display name of the service is "Print Spooler", the command would be written as: "Stop-Service -DisplayName "Print Spooler"". Executing this command would stop the "Print Spooler" service.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the Stop-Service tool