TestimoX

API Reference

Command

Test-CxPort

Namespace ComputerX.PowerShell

Tests whether a TCP port is reachable on a target computer.

Examples

Authored help example

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 requiredposition: 0pipeline: false
Executes the cmdlet processing logic (ProcessRecord). Invoked by the PowerShell runtime; not intended to be called directly.
Port int requiredposition: 1pipeline: false
TCP port number to test on the target host.
TimeoutMs int optionalposition: 2pipeline: false
Timeout, in milliseconds, for the TCP connection attempt.