Get all active ports and show what's running on it
Created: 2026-04-05 19:00:59 | Last updated: 2026-04-05 19:00:59 | Status: Public
Get-NetTCPConnection | ForEach-Object { $cmd = (Get-WmiObject Win32_Process -Filter “ProcessId=$($.OwningProcess)”).CommandLine; [PSCustomObject]@{Port=$.LocalPort; PID=$_.OwningProcess; Command=$cmd} } | Sort-Object Port | Format-Table -AutoSize -Wrap