Ping hosts from PowerShell (Test-Connection)
The PowerShell-native ping: send ICMP echo requests to several computers in one line and get structured results you can filter and script.
01Command
$ Test-Connection example.com, gateway.local -Count 402What it does
Test-Connection returns objects with properties like Address, ResponseTime and Status, so workflows like 'ping a whole subnet and list only responders' become one pipeline instead of text scraping. It accepts multiple targets in a single call, and in PowerShell 7 the parameter is -TargetName (Windows PowerShell 5.1 uses -ComputerName). Combine with -Quiet to get just a True/False boolean for conditional logic.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Test-Connection - PowerShell - SS64Evidence: SS64 documents Test-Connection as sending ICMP echo requests to one or more computers, accepting a list of targets and a -Count parameter, and returning status objects usable in pipelines.
Last verified: 2026-09-17 · Category: Network
06Related solutions
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
Purge cached DNS lookups so Windows re-resolves hostnames from scratch — the fix for 'the new server is live but my browser still hits the old one'.
Search inside text files and logs with regex, returning file, line number and match.