我已按照以下步骤
在D:\Chocolatey
目录中安装了Chocolatey
https://github.com/chocolatey/choco/wiki/Installation#installing-to-a-different-location
可行,但我必须更改环境变量ChocolateyInstall
并手动创建文件夹D:\Chocolatey
。
有没有办法只使用cmd在非默认目录中安装Chocolatey?
答案 0 :(得分:2)
setx ChocolateyInstall D:\Chocolatey /M
& setx.exe ChocolateyInstall D:\Chocolatey /M
setx ChocolateyInstall D:\Chocolatey /M && SET "ChocolateyInstall=D:\Chocolatey" && "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
您只需尝试SET "ChocolateyInstall=D:\Chocolatey"
,看看它是否适用于安装。