Terminal Dojo
Help العربية Sign inGet started

Command library / Test-NetConnection

Test-NetConnection

PowerShellDraft — pending expert review4 practice missions

Test connectivity to a host and TCP port

PowerShell's all-in-one connectivity check: ping, TCP port test and route tracing in a single cmdlet. It returns an object (TcpTestSucceeded, RemotePort …) instead of text, so it composes well in scripts. PowerShell names and parameters are case-insensitive, and `tnc` is a built-in alias.

Practice Test-NetConnection

Usage

Test-NetConnection [[-ComputerName] <String>] [-Port <Int32>] [-InformationLevel <String>] [-TraceRoute] [-CommonTCPPort <String>]

Options and flags

Examples

Common mistakes

Test-NetConnection 10.0.0.5 -Port Test-NetConnection 10.0.0.5 -Port 445

-Port needs a port number right after it.

Related commands

netstatping