[英]Powershell test-connection hangs
I am experiencing a problem running the Test-Connection command from one of my scripting servers.我在从我的一个脚本服务器运行 Test-Connection 命令时遇到问题。 Simply running the command
Test-Connection -ComputerName $Hostname -Count 1 -ErrorAction Stop
hangs the powershell session.只需运行命令
Test-Connection -ComputerName $Hostname -Count 1 -ErrorAction Stop
挂起 powershell session。 Running the ping command works as expected.运行 ping 命令按预期工作。 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.
我知道 Test-NetConnection 并且这是可行的,但是,我需要知道 Test-Connection 挂在这台服务器上的根本原因。 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. Test-NetConnection
是Test-Connection
的继承者,它增加了一些功能,例如端口可用性检查和tracert
功能。
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.我需要查看确切的错误以了解它是否实际上是超时问题,如果是这样,
Test-Connection
的默认超时必须低于Test-NetConnection
或者可能是因为Test-Connection
仅使用 ICMP(Internet 控制消息协议) 和Test-NetConnection
即使它可以使用此协议,如果通过参数询问也可能不会将其用作默认协议。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.