安装chocolatey:
按window键输入cmd或者命令提示符,以管理员身份运行,直接运行下方命令(代码),也可自行去官网查看如何安装
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
看看安装报错情况:
解决方案:
直接打开网址:
https://chocolatey.org/install.ps1
右键另存为install.ps1文件(相当于下载install.ps1)
cmd管理员运行,切换到下载的install.ps1所在目录
运行下面代码:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
查看是否安装成功:
choco
OK 安装成功