Al-*_*min 3 windows chocolatey
我正在尝试安装 Chocolatey
https://chocolatey.org/install
Run Code Online (Sandbox Code Playgroud)
并使用命令:
@"%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"
Run Code Online (Sandbox Code Playgroud)
它显示错误:
Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompression = 'true' and call install
again. Error: 7-Zip encountered a fatal error while extracting the files
At line:221 char:9
+ 2 { throw "$errorMessage 7-Zip encountered a fatal error while ex ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unable to unzip...cting the files:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompres
sion = 'true' and call install again. Error: 7-Zip encountered a fatal error while extracting the files
Run Code Online (Sandbox Code Playgroud)
我安装了 7zip。
Har*_*n O 10
我遇到了同样的问题。
cmd以管理员身份运行窗口可能是某些人的解决方案,但在我的情况下,我必须更新我的窗口系统环境变量,我只是将其添加到路径 上的退出值
:$env:chocolateyUseWindowsCompression = 'true'
并且一切正常。