stop-process in PowerShell

Stop a process by port number

If you need to stop a process that is listening on a known port, you can do it with the Stop-Process command combined with Get-NetTCPConnection

Let us stop the process on port 8000

Stop-Process -Id (Get-NetTCPConnection -LocalPort 8000).OwningProcess -Force

Banner image

Article author: Andrei Olegovich