Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find what process is using a port on Windows
$Port = "8080"
netstat -a -n -o | where { $_ -match $Port } | foreach {
$Process = Get-Process -PID (($_ -replace "\s+"," ") -split " ")[-1]
"Process: $($Process.ProcessName) ($($Process.Id)) is using $Port"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment