GzGit in the Zone

Dictionary · Linux and Windows Commands

Test-NetConnection

Connectivity · Intermediate

A PowerShell cmdlet that tests a network path, including a ping-style reachability check and a test of a specific TCP port.

It combines a basic reachability check with the question administrators actually have: does this port accept a connection? Use it against hosts you are allowed to test.

Example: Test-NetConnection example.com -Port 443 reports whether TCP 443 can be reached.

Command

Platform: Windows PowerShell

Test-NetConnection example.com -Port 443

TcpTestSucceeded True means the TCP connection was accepted. PingSucceeded is a separate reachability check and may be false even when the port test works.

Common misconception

  • A failed port test can mean a firewall, a stopped service, or a wrong name. The cmdlet does not choose among those causes for you.

Related terminology

Quiz this category