我在命令行中输入代码:
@"%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"
我也遇到了同样的问题,但是通过这种方法,它工作正常。使用PowerShell方法->
在管理员命令提示符下输入这些代码->
powershell
Get-ExecutionPolicy
((如果受限制,则返回set-ExecutionPolicy AllSigned)
Set-ExecutionPolicy AllSigned
Get-ExecutionPolicy
> Set-ExecutionPolicy绕过-Scope Process -Force; [System.Net.ServicePointManager] :: SecurityProtocol = [System.Net.ServicePointManager] :: SecurityProtocol -bor 3072; iex(((新对象System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
有关更多参考,请访问此处https://chocolatey.org/docs/installation#install-using-powershell-from-cmdexe
下图清楚地说明了您必须执行的操作...