1.配置安裝路徑(后續需要管理員權限執行命令)
- Create a machine level (user level will also work) environment variable named
ChocolateyInstall
and set it to the folder you want Chocolatey to install to prior to installation (this environment variable must be set globally or available to PowerShell- it is not enough to simply make it available to your current command prompt session). - Don't use
"C:\Chocolatey"
unless necessary. - Create the folder manually.
- If you have already installed (and want to change the location after the fact):
- Follow the above steps.
- Install Chocolatey again.
- Copy/Move over the items from the old lib/bin directory.
- Delete your old install directory.
2.安裝方法 https://chocolatey.org/docs/installation
# cmd.exe @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" # powershell.exe iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) # powershell v3+ iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
3. 代理設置
choco config set proxy http://localhost:8888
4.常用命令:https://chocolatey.org/docs/commands-reference
choco search 關鍵字
choco install 軟件包名稱
choco upgrade 軟件包名稱
choco uninstall 軟件包名稱
5.倉庫地址:https://chocolatey.org/packages/
6.安裝位置設置
環境變量中增加 ChocolateyToolsLocation : 想安裝的地點