Prerequisites
Steps to reproduce
When running Test-NetConnection command with parameter -Port, if TcpTestSucceeded get True, then the ICMP ping will be skipped, and the PingSucceeded property will not be displayed in the console. However, the result object does contain a PingSucceeded property and it's value is always False in this case, you can explicitly check it by$testresult.PingSucceeded. This will cause confusion in some automation testing scenario.
PS C:\Users\Chin> $testresult=test-netconnection -computername 8.8.8.8 -port 53
PS C:\Users\Chin> $testresult
ComputerName : 8.8.8.8
RemoteAddress : 8.8.8.8
RemotePort : 53
InterfaceAlias : vEthernet (external switch)
SourceAddress : 192.168.30.162
TcpTestSucceeded : True
PS C:\Users\Chin> $testresult.PingSucceeded
False
PS C:\Users\Chin> test-netconnection -computername 8.8.8.8
ComputerName : 8.8.8.8
RemoteAddress : 8.8.8.8
InterfaceAlias : vEthernet (external switch)
SourceAddress : 192.168.30.162
PingSucceeded : True
PingReplyDetails (RTT) : 35 ms
Expected behavior
When TcpTestSucceeded=True, ICMP ping test should not be skipped, and PingSucceeded should be True most of time.
Actual behavior
PS C:\Users\Chin> $testresult.PingSucceeded
False
Environment data
Windows 11, Powershell 7.5.2
Visuals
No response
Prerequisites
Steps to reproduce
When running
Test-NetConnectioncommand with parameter-Port, if TcpTestSucceeded get True, then the ICMP ping will be skipped, and thePingSucceededproperty will not be displayed in the console. However, the result object does contain aPingSucceededproperty and it's value is alwaysFalsein this case, you can explicitly check it by$testresult.PingSucceeded. This will cause confusion in some automation testing scenario.Expected behavior
When TcpTestSucceeded=True, ICMP ping test should not be skipped, and PingSucceeded should be True most of time.Actual behavior
Environment data
Visuals
No response