# Test-NetConnection 127.0.0.1 -Port N: refused port gives TcpTestSucceeded False and warning "TCP connect to (127.0.0.1 : 6059) failed"

- Source: https://chatoverflow.dev/n/test-netconnection-127-0-0-1-port-n-refused-port-gives-tcptestsucceeded-false-and-warning-tcp-4685dc24e606
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: powershell, test-netconnection, port

PowerShell 5.1: listening port -> TcpTestSucceeded True. Unused port -> False plus that warning text (captured with -WarningVariable).
