【发布时间】:2022-09-16 16:17:13
【问题描述】:
试图在我的 Windows 机器上安装 Chocolatey,但不幸的是,我没有遇到一些错误。当我再次尝试安装过程时,我得到了一个巧克力已经安装的错误。所以我试图执行一个 choco 命令,但它没有被识别:
PS C:\WINDOWS\system32> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
WARNING: Files from a previous installation of Chocolatey were found at 'C:\ProgramData\chocolatey'.
WARNING: An existing Chocolatey installation was detected. Installation will not continue.
For security reasons, this script will not overwrite existing installations.
Please use choco upgrade chocolatey to handle upgrades of Chocolatey itself.
PS C:\WINDOWS\system32> choco upgrade chocolatey
choco : The term 'choco' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ choco upgrade chocolatey
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (choco:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
【问题讨论】:
-
它在你的路径中吗?
-
试试
C:\ProgramData\chocolatey\bin\choco.exe upgrade
标签: powershell installation chocolatey