To kill a process, you can use the command Stop-Process.

Or you can try Ctrl + Break shortcut.

Answer from bluray on Stack Overflow
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › microsoft.powershell.management › stop-process
Stop-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
The Stop-Process cmdlet stops one or more running processes. You can specify a process by process name or process ID (PID), or pass a process object to Stop-Process. Stop-Process works only on processes running on the local computer. On Windows Vista and later versions of the Windows operating system, to stop a process that is not owned by the current user, you must start PowerShell by using the Run as administrator option.
🌐
PDQ
pdq.com › blog › what-is-the-powershell-equivalent-of-taskkill
What is the PowerShell equivalent of taskkill? | PDQ
February 12, 2026 - TL;DR: The PowerShell equivalent of taskkill is Stop-Process. It terminates running processes by name or ID, supports force-stopping unresponsive apps, and works natively with Get-Process for safer scripting. If you’re coming from Command Prompt and moving your workflows into PowerShell, process management is one of the first things you’ll want to translate.
Discussions

windows - How do I kill a process in Powershell - Stack Overflow
Say I'm running a python script that doesn't exit properly. The powershell console does not return control to me without having to close the shell and open a new one. With Bash I can simply press C... More on stackoverflow.com
🌐 stackoverflow.com
Simple command to kill off several instances of the same .exe
Stop-Process -Name "ProcessName" -Force Or without powershell taskkill /IM "process.exe" /F In both of these we include a force method, I honestly like taskkill over PS option here as it has some built in flags that save you some piping. Speficcally /t adding that to taskill kills all the child processes, important but dangerous. More on reddit.com
🌐 r/PowerShell
10
3
January 19, 2021
powershell - How do I kill a processes running a given executable? - Stack Overflow
I want to kill a job. First, I need it's process Id, so I execute: get-process And I get a boatload of processes. OK, I just want one particular process, so I use: get-process | select-string -p... More on stackoverflow.com
🌐 stackoverflow.com
Kill a process after it runs for X amount of time
The win32_service WMI class includes process information like the processId. The process information returned by Get-Process includes a starttime. More on reddit.com
🌐 r/PowerShell
9
5
October 16, 2020
People also ask

How do I stop a PowerShell command from running?

You can interrupt and stop a PowerShell command while it is running by pressing Control-C. A script can be stopped with the command exit. This will also close the PowerShell console.

🌐
comparitech.com
comparitech.com › home › net admin › tutorial: powershell kill process command
PowerShell Kill Process Command: Step-by-Step Tutorial
How do I kill Windows processes from the command line?

At the command line, you can terminate a Windows process with the command taskkill. To use this command, you need to know its process ID (PID). You can get a list of all running tasks with the command tasklist. Once you know the PID, use the taskkill command in this manner: taskkill /PID /F. Type in the process ID without quotes instead of .

🌐
comparitech.com
comparitech.com › home › net admin › tutorial: powershell kill process command
PowerShell Kill Process Command: Step-by-Step Tutorial
What is the kill PID command?

The kill command is used on Linux to terminate a running process. The format is just kill followed by the process ID. You can get a list of running processes by using the top command. The kill command doesn’t work in Windows – use taskkill instead.

🌐
comparitech.com
comparitech.com › home › net admin › tutorial: powershell kill process command
PowerShell Kill Process Command: Step-by-Step Tutorial
🌐
Comparitech
comparitech.com › home › net admin › tutorial: powershell kill process command
PowerShell Kill Process Command: Step-by-Step Tutorial
November 11, 2024 - Once you know the PID, use the taskkill command in this manner: taskkill /PID <PID> /F. Type in the process ID without quotes instead of <PID>. The kill command is used on Linux to terminate a running process.
🌐
Dzhavat Ushev
dzhavat.github.io › 2020 › 04 › 09 › powershell-script-to-kill-a-process-on-windows.html
PowerShell script to kill a process on Windows | Dzhavat Ushev
Most blog posts related to killing a process on Windows show the following solution: C:\> netstat -ano | findstr "PID :PortNumber" List of processes using a particular port · C:\> taskkill /PID pidNumber /F · Terminating a process by PID · This solution works fine but it’s manual, the ...
Find elsewhere
🌐
SharePoint Diary
sharepointdiary.com › sharepoint diary › powershell › how to kill a process in powershell with stop-process?
How to Kill a Process in PowerShell with Stop-Process? - SharePoint Diary
October 22, 2025 - Type the PowerShell command Get-Process to view a list of running processes and their process IDs · Identify the process ID of the process that you want to kill · Type Stop-Process -Id "Process ID" to kill the process · Replace with the process ...
Top answer
1 of 2
8

Select-String is probably not the hammer you wanna use for this particular nail (see below) :-)

Get-Process has a -Name parameter that takes a wildcard:

Get-Process -Name nginx
# or
Get-Process -Name *nginx*

To kill the process, either call Kill() directly on the object:

$nginxProcess = Get-Process nginx |Select -First 1
$nginxProcess.Kill()

... or simply pipe the process instances to Stop-Process:

Get-Process -Name nginx |Stop-Process

As you can see, we never actually need to locate or pass the process id - the Process object already has that information embedded in it, and the *-Process cmdlets are designed to work in concert - PowerShell is all about command composition, and this is an example of it.

That being said, Stop-Process is also perfectly capable of killing processes by name alone:

Stop-Process -Name nginx

How did I know the *-Process cmdlets had a -Name parameter?

Apart from reading the help files and documentation (I get it, I don't want to read anything either unless I absolutely have to ;-)), a quick way to learn about the parameters exposed by a cmdlet is by running Get-Command <commandName> -Syntax:

PS ~> Get-Command Stop-Process -Syntax

Stop-Process [-Id] <int[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

Stop-Process -Name <string[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

Stop-Process [-InputObject] <Process[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

The output shows us 3 distinct "parameter sets" (combinations of parameter input accepted by the command), and the required and optional arguments we can pass to it.


What's wrong with Select-String?

The Select-String cmdlet is the PowerShell cognate to grep - it takes some input, and performs regular expression matching against it based on whatever pattern you give it.

But grep is only useful when you're operating on strings - and as you've already found, Get-Process returns structured .NET objects, not flat strings.

Instead, the PowerShell-idiomatic approach is to filter the data, using the Where-Object cmdlet:

Get-Process | Where-Object Name -like '*nginx*'

Here, we instruct Where-Object to only let through object that have a Name property, the value of which must satisfy the wildcard pattern *nginx*.

Where-Object also supports arbitrary filter expressions, by accepting a scriptblock - PowerShell will assign the current pipeline object being evaluated to $_ (and $PSItem):

Get-Process | Where-Object { $_.Name -like '*nginx*' }

... which you can extend to whatever degree you need:

# Only let them through if a specific user is executing
Get-Process | Where-Object { $_.Name -like '*nginx*' -and $env:USERNAME -ne 'Quarkly'}
2 of 2
1

Note: PowerShell must be run as Administrator in order to execute these commands.

Kill a process with a known PID:

Syntax:

Stop-Process -Force -Id <pid>

Example:

Stop-Process -Force -Id 1234

Kill a process with a known name:

Syntax:

Stop-Process -Force -Name <name>

Example:

Stop-Process -Force -Name Taskmgr

Kill a process with a name wildcard search pattern

Syntax:

Get-Process -Name <pattern> | Stop-Process -Force

Example:

Get-Process -Name *skmg* | Stop-Process -Force
🌐
ITPRC
itprc.com › home › network tools
How To Use PowerShell To Kill Processes - Step-by-Step Guide
March 12, 2021 - Soon you’ll see a list of all ... PID on the process that you want to kill and then execute the following command: taskkill /f /PID 00000....
🌐
SS64
ss64.com › ps › stop-process.html
Stop-Process kill - PowerShell - SS64.com
# get Firefox process $firefox = Get-Process firefox -ErrorAction SilentlyContinue if ($firefox) { # try gracefully first $firefox.CloseMainWindow() # kill after five seconds Sleep 5 if (!$firefox.HasExited) { $firefox | Stop-Process -Force } } Remove-Variable firefox ... Stop process ID# 6464 and prompt before stopping the process (this will display the process name first): ... Invoke-Command - Run commands on local and remote computers.
🌐
NinjaOne
ninjaone.com › home › blog › it ops › how to kill a process in windows: 4 methods
How to Kill a Process in Windows | NinjaOne
April 30, 2025 - This command can end a process if Task Manager doesn’t end it and you don’t want to restart your device. Here’s how to end Windows tasks using the PowerShell Stop-Process cmdlet:
🌐
Websentra
websentra.com › powershell-kill-process-command
Tutorial: PowerShell Kill Process Command - Step-by-Step Guide
July 28, 2023 - The Stop-Process is PowerShell’s own way to kill a process (although they prefer to use the word “Stop” rather than killing!). Stop-Process is a cmdlet that performs similar to the TASKKILL command but gives you a slightly different set of options.
🌐
Virtualization Howto
virtualizationhowto.com › home › devops › powershell kill a process from the command line
PowerShell Kill a Process from the Command Line - Virtualization Howto
August 16, 2024 - This allows for precise identification. # List process with a specific PID (e.g., 1234) Get-Process -Id 1234 ... An alternative to the taskkill command is the stop process command in PowerShell.
🌐
ITT Systems
ittsystems.com › home › powershell kill process command – step-by-step tutorial
PowerShell Kill Process Command – Step-by-Step Tutorial
July 26, 2023 - In this guide, you learned how to kill a process using the stop-process and taskkill command in PowerShell. You can also kill a process in the remote server using PowerShell.
🌐
disown
webservertalk.com › powershell › kill-process
PowerShell Kill Process Command - End/Shutdown a Program!
May 4, 2021 - Next, open the PowerShell interface and run the following command to list all running processes and their PIDs: ... If you want to terminate the application WordPad, you will need to kill the process of wordpad.exe and cmd.exe application by its PID or by its name.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › windows › 4 ways to use the taskkill command in cmd & powershell
4 Ways to Use the Taskkill Command in CMD & PowerShell
February 19, 2026 - Type the "tasklist" command and find a program you want to end. Type "taskkill /IM [image name]" and hit Enter. Use " /F" at the end of the command to force-close the process, and type "/T" to kill all its child processes.
🌐
Windows Command Line
windows-commandline.com › powershell-kill-process
How to Kill process from PowerShell
May 15, 2019 - Powershell provides command Stop-Process to kill a process from command prompt.
🌐
Marc Nuri
blog.marcnuri.com › home › windows: how to kill a process from the command line
Windows: How to kill a process from the command line - Marc Nuri
October 31, 2023 - In this post, I've shown you the possible ways to kill a process from the command line in Windows. Using the taskkill command from cmd or the Stop-Process cmdlet from powershell.
🌐
Computer Performance
computerperformance.co.uk › home › powershell
PowerShell Scripting Basics: Kill Process | Stop-Process | Code Examples
January 15, 2019 - See how Task Manager sets process priority in Windows 8 » · Typical Microsoft, there are always at least two way of achieving the same goal. Example 3 provides the simplest and most descriptive method of closing all notepad.exe programs. # PowerShell 'Stops' Windows Process Clear-Host Stop-Process -name notepad · Note 4: Strictly speaking, the parameter is -processName · Note 5: The Stop-Process is versatile. If you execute a command with this Verb-Noun combination, then you need either the -name parameter, or the -id parameter.