Search notes:

PowerShell Cmdlet: Stop-Process

stop-process stops (kills) the processes that match the given criteria.
stop-process -name excel
stop-process -id $pidOfProcess

$np = get-process -name notepad
stop-process -inputObject $np

Fining process id if multiple processes have the same name

At times, there are multiple processes with the same name, and only one of them needs to be killed. stop-process gimp* for example would kill every process that starts with gimp.
So, in order to find the «correct» process id, the following pipeline might help.
PS:\> get-process gimp* | select id, starttime
This pipeline prints a process id along with the time when a process has started which sometimes is an indication which process should be stopped.

Alias

kill is an alias for stop-process. (Compare with the equally named Linux shell command kill.

See also

Powershell command noun: process

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758201510, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-inventory/noun/process/stop/index(58): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78