如何在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 好听的元旦简短祝福语