Commands / Network

Test-NetConnection

Test a TCP port or route

beginner Network Aliases tnc

Test-NetConnection
 Test-NetConnection -ComputerName example.com -Port 443
Works on
Windows
PowerShell
5.1 and later
Reference
Microsoft Learn: Test-NetConnection

Windows-only and slower than Test-Connection. Worth it when you care about a port. TcpTestSucceeded is the property that matters.

Try this

Test-NetConnection -ComputerName example.com -Port 443 | Select-Object ComputerName, RemotePort, TcpTestSucceeded

Coming from another shell

ShellWhat you might type
bash / zshnc -zv example.com 443

More in From bash and From cmd.

Related commands