Add list-network-connections.ps1

This commit is contained in:
Markus Fleschutz 2022-11-22 08:40:38 +01:00
parent d739604c79
commit fae30d1d3f

View File

@ -0,0 +1,20 @@
<#
.SYNOPSIS
Lists network connections
.DESCRIPTION
This PowerShell script lists all active network connections on the local computer.
.EXAMPLE
PS> ./list-network-connections
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
& netstat -n
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}