Skip to content

Instantly share code, notes, and snippets.

@timheuer
Created August 23, 2024 23:54
Show Gist options
  • Save timheuer/fefce3ef962cd34b8d87b899e56cd77b to your computer and use it in GitHub Desktop.
Save timheuer/fefce3ef962cd34b8d87b899e56cd77b to your computer and use it in GitHub Desktop.
find the process info for who is owning a port
# Find out what is running on a port
# used like `whoport 22112`
function whoport
{
param
(
[int] $port
)
Get-Process -Id (Get-NetTCPConnection -LocalPort $port).OwningProcess
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment