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
