1.在Win10开始菜单的搜索框中输入“命令提示符”即可自动搜索到“命令提示符”工具;

2.右键点击“命令提示符”,选择“以管理员身份运行”即可打开“管理员:命令提示符”窗口;

3.输入:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

  

4.输入 choco,展示出版本号即为成功;

 

问题:

PS C:\choco-setup\packages> Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).Dow
nloadString('https://chocolatey.org/install.ps1'))
使用“1”个参数调用“DownloadString”时发生异常:“请求被中止: 未能创建 SSL/TLS 安全通道。”
所在位置 行:1 字符: 51
+ ... ess -Force; iex ((New-Object System.Net.WebClient).DownloadString('ht ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException

 

解决

  

ps中输入:     [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

相关文章:

  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2021-05-01
  • 2021-07-12
  • 2022-12-23
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-09-28
  • 2021-12-04
  • 2022-02-22
  • 2021-06-04
相关资源
相似解决方案