How To Kill Process In PowerShell?

Windows PowerShell provides different command in order to manage processes. The Stop-Process commandlet can be used to kill or stop processes in Windows using the PowerShell command-line interface. The Stop-Process commandlet can be used to kill a process using the ProcessID or Process Name.

Stop-Process Syntax

The Stop-Process has the following syntax.

Stop-Process -Name PROCESS_NAME
Stop-Process -Id PROCESS_ID
  • -Name PROCESS_NAME is used to specify the process name to kill.
  • -Id PROCESS_ID is used to specify the process id to kill.

List Process ID and Process Name

Before killing the process via its process id or process name we should list the processes with their process id or process name. The Get-Process command is used to list all running processes with their information like Process ID and Process Name.

PS> Get-Process
List Process ID and Process Name

Kill Process with Process ID

A process can be killed according to its process ID. Using process ID to kill a process is better than killing process with its name because the same executable can be used by multiple processes with the same process name.The -Id option is used to specify the process we want to kill.

PS> Stop-Process -Id 1292

Alternatively, multiple processes IDs can be specified at once in order to kill multiple processes at once with the single Stop-Process command.

PS> Stop-Process -Id 1292,3224

Kill Process with Process Name

Processes can be killed with their name too. But keep in mind that multiple processes can use the same process ID because the process ID is generally derived from the executable of the processes and running single executable multiple times create multiple processes with the same name. The -Name option is used to specify the process name we want to kill.

PS> Stop-Process -Name chrome

Kill Process Examples

Below you can find popular kill process command examples.

See also  How To Kill Process In Windows?
DescriptionCommand
Kill All Chrome ProcessesStop-Process -Name chrome
Kill All Edge ProcessesStop-Process -Name edge
Kill All File ExplorerStop-Process -Name explorer

Leave a Comment