执行Invoke-WebRequest -Uri https://www.freehaven.net/anonbib/date.html
PowerShell 行时会抛出WebCmdletResponseException
. 我怎样才能获得有关它的更多信息,以及可能导致这种情况的原因是什么?虽然我可以使用 Python 成功获取页面的内容,但在 PowerShell 中它会引发异常。
完全例外:
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send. At line:1 char:1 + Invoke-WebRequest -Uri https://www.freehaven.net/anonbib/date.html + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand