powershell无法ping web地址

powershell无法ping web地址,powershell,ping,Powershell,Ping,我在Windows 10 64位中以管理员身份运行powershell。当我pingwww.powershellgallery.com时,我得到错误: PS C:\WINDOWS\system32> ping www.powershellgallery.com Pinging psg-prod-eastus.cloudapp.net [40.87.85.101] with 32 bytes of data: Request timed out. Ping statistics for

我在Windows 10 64位中以管理员身份运行powershell。当我ping
www.powershellgallery.com
时,我得到错误:

PS C:\WINDOWS\system32> ping www.powershellgallery.com

Pinging psg-prod-eastus.cloudapp.net [40.87.85.101] with 32 bytes of data:
Request timed out.

Ping statistics for 40.87.85.101:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
但当我点击其他网址时,比如google.com,一切都很好

PS C:\WINDOWS\system32> ping www.google.com

Pinging www.google.com [216.58.213.68] with 32 bytes of data:
Reply from 216.58.213.68: bytes=32 time=15ms TTL=56
Reply from 216.58.213.68: bytes=32 time=14ms TTL=56
Reply from 216.58.213.68: bytes=32 time=13ms TTL=56
Reply from 216.58.213.68: bytes=32 time=13ms TTL=56

Ping statistics for 216.58.213.68:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 13ms, Maximum = 15ms, Average = 13ms

知道发生了什么吗?

这真的不是powershell问题。事实上,这根本不是问题。Ping正在使用ICMP。这基本上是一条回音信息。公司可以阻止和不允许ICMP


因此,没有ping并不意味着某些东西不工作。

一些web服务器配置为不响应ping。正如ArcSet在上面回答的那样,ping失败并不意味着网站已经关闭。 幸运的是,有一个快速修复方法:TestNetConnection,它允许您检查特定端口。语法如下所示(本例中为HTTPS):

测试网络连接powershellgallery.com-端口443

此外,您还可以添加开关信息级别。在这种情况下,响应要短得多(True或False),如果您想在脚本中使用它,这非常方便

测试网络连接powershellgallery.com-端口443-信息级静音


干杯。

你的网络是否被禁止,比如像在中国一样?我在英国。当我尝试从PSGallery安装程序包时,我的机器似乎无法ping任何Azure网站。我收到一个错误。另外,Get-PSRepository不起作用。但另外两名同事可以正常访问PSGallery。这和我的笔记本电脑有关,而不是我工作的公司。你的问题不是装包裹。这就是为什么您不能ping。@user3417479您需要关闭此问题,因为它不是ping问题。然后问一个正确的问题,为什么一个包不能加载,以及你用来加载一个包的代码你是对的。ping即使在操作笔记本电脑上也不起作用。至少我们学到了一些东西