TL;DR

No nc on Windows: Test-NetConnection -ComputerName host -Port port. Check TcpTestSucceeded.

On Linux the reflex for “is 1433 open?” is:

1
nc -v 10.1.1.1 1433

Windows does not ship nc. The closest PowerShell equivalent is a TCP connect test:

1
Test-NetConnection -ComputerName 10.1.1.1 -Port 1433

Short alias:

1
tnc 10.1.1.1 -Port 1433

What to look at

TcpTestSucceeded:

ValueMeaning
TruePort is open and answering (same as nc connecting)
FalseNo connection (firewall, dead service, unreachable IP)

More detail, closer to nc -v:

1
Test-NetConnection -ComputerName 10.1.1.1 -Port 1433 -InformationLevel Detailed

Port only, no ping

Test-NetConnection also pings by default. TCP only:

1
2
Test-NetConnection -ComputerName 10.254.3.2 -Port 1433 -WarningAction SilentlyContinue |
  Select-Object ComputerName, RemoteAddress, RemotePort, TcpTestSucceeded

Very old PowerShell

If Test-NetConnection is missing, use the .NET TCP client:

1
2
3
4
5
6
7
8
9
$tcp = New-Object System.Net.Sockets.TcpClient
try {
    $tcp.Connect("10.254.3.2", 1433)
    Write-Host "Connected to 10.254.3.2:1433"
} catch {
    Write-Host "Failed: $($_.Exception.Message)"
} finally {
    $tcp.Close()
}