Created
August 23, 2024 23:54
-
-
Save timheuer/fefce3ef962cd34b8d87b899e56cd77b to your computer and use it in GitHub Desktop.
find the process info for who is owning a port
This file contains 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
# 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