Test Ports With Test-NetConnection
Check connectivity, DNS resolution and a specific TCP port with one cmdlet.
01Command
$ Test-NetConnection example.com -Port 44302What it does
The cmdlet returns a structured object with DNS resolution results, ping replies and TCP test results, so a script can branch on connectivity without parsing text. That makes it the natural building block for health checks and preflight validation on Windows.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Test-NetConnectionEvidence: Tests network connectivity and TCP port reachability.
Last verified: 2026-10-13 · Category: Network
06Related solutions
The nuclear option for broken connectivity: rebuild Winsock and the TCP/IP stack to defaults when adapters show 'no internet' despite everything else working.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
PowerShell cmdlet that exposes BIOS, firmware, RAM and OS properties as a filterable object.