1.在Win10开始菜单的搜索框中输入“命令提示符”即可自动搜索到“命令提示符”工具;
2.右键点击“命令提示符”,选择“以管理员身份运行”即可打开“管理员:命令提示符”窗口;
3.输入:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin
4.输入 choco,展示出版本号即为成功;
问题:
PS C:choco-setuppackages> 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