Created
May 6, 2022 20:58
-
-
Save lzehrung/684d3f3fdc64670bb09db7b71fa8c8fb to your computer and use it in GitHub Desktop.
open connections
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
netstat -p TCP -fan | Select -Skip 4 | ForEach { | |
$Properties = $_.Trim() -split '[\s]+' | |
[PSCustomObject]@{ | |
'Proto'= $Properties[0] | |
'Local Address'= $Properties[1] | |
'Foreign Address'= $Properties[2] | |
'State'= $Properties[3] | |
} | |
} | Select -Expand 'Foreign Address' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment