# Sample: one authorised destination, one TCP port. No scanning or stored secrets. [CmdletBinding()] param( [ValidateNotNullOrEmpty()][string]$ComputerName = 'localhost', [ValidateRange(1,65535)][int]$Port = 443 ) $result = Test-NetConnection -ComputerName $ComputerName -Port $Port -WarningAction SilentlyContinue [pscustomobject]@{ Target = $ComputerName Port = $Port TcpReachable = [bool]$result.TcpTestSucceeded } # TCP reachability does not verify TLS, authentication or application health.