運行invoke-webrequest報錯:
根據你的 PowerShell、.NET Framework 的版本和升級,WEB 連接的缺省安全協議可能仍然是 SSL3。
您可以方便地查明它:
[Net.ServicePointManager]::SecurityProtocol
返回的協議不包含 Tls12,那么可能無法用 PowerShell 連接到安全的 Web Service 和網站。
我們只需要這樣操作就可以啟用更多的服務:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol
至此問題已經完全解決