简体   繁体   中英

Powershell test-connection hangs

I am experiencing a problem running the Test-Connection command from one of my scripting servers. Simply running the command Test-Connection -ComputerName $Hostname -Count 1 -ErrorAction Stop hangs the powershell session. Running the ping command works as expected. The issue is specific to this one server I am running the command from. Other servers are running the command and returning the expected values. I know about Test-NetConnection and this works, however, I need to know the root cause why Test-Connection is hanging on this one server. Any advice is greatly appreciated.

Test-NetConnection is the successor of Test-Connection , it adds a few functionalities like port availability check and tracert functionality.

I would need to see the exact error to know if it is in fact a timeout issue, if so the default timeout for Test-Connection must be lower than Test-NetConnection or maybe its because Test-Connection uses only ICMP (Internet Control Message Protocol) and Test-NetConnection even though it can use this protocol if asked by parameter may not use it as the default protocol.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM