API Reference
Command
Test-CxPort
Tests whether a TCP port is reachable on a target computer.
Examples
Example 1: Tests whether WinRM is reachable on a remote server.
PS>
Test-CxPort -ComputerName APP01 -Port 5985
Example 2: Tests whether a SQL listener is reachable with a longer timeout.
PS>
Test-CxPort -ComputerName SQL01 -Port 1433 -TimeoutMs 5000
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Test-CxPort -ComputerName <string> -Port <int> [-TimeoutMs <int>] [<CommonParameters>]#Parameters
- ComputerName string
- Executes the cmdlet processing logic (ProcessRecord). Invoked by the PowerShell runtime; not intended to be called directly.
- Port int
- TCP port number to test on the target host.
- TimeoutMs int
- Timeout, in milliseconds, for the TCP connection attempt.