如何在PowerShell中更改TLS版本?
当使用URI命令(例如Invoke-WebRequest或Invoke-Restmethod命令)和打包命令(例如Find-Package或Install-Package)时,称为TLS的传输层安全性是非常重要的部分,因为它们在Internet上交互并且PowerShell需要TLS1.2版本为了那个原因。
当使用较低的TLS版本时,我们可能会出现以下错误。
WARNING: Unable to download the list of available providers. Check your internet connection. WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'. Find-Package : No match was found for the specified search criteria and package name
要解决以上错误,我们需要更改TLS版本。要检查现有的TLS版本,我们可以使用以下命令,
PS C:\> [Net.ServicePointManager]::SecurityProtocol Ssl3, Tls
要将TLS版本更改为1.2,可以使用以下命令。
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短