如何在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
热门推荐
10 新人红包祝福语简短精辟
11 幼师给毕业祝福语简短
12 生日高考祝福语妹妹简短
13 下飞机祝福语简短英文
14 元宵发客户祝福语简短
15 爸妈金婚文案祝福语简短
16 新郎朋友红包祝福语简短
17 虎年五一祝福语大全简短
18 出阁宴祝福语姐姐简短