【发布时间】:2018-02-03 23:36:05
【问题描述】:
执行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
【问题讨论】:
标签: powershell ssl httpwebrequest tls1.2 servicepointmanager