Created
March 12, 2019 14:32
-
-
Save Tiberriver256/1aafa398dea7eb6a10c322bfda34cc31 to your computer and use it in GitHub Desktop.
Find what process is using a port on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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