巧克力安装:警告:您很可能需要关闭并重新打开外壳

时间:2016-04-25 17:35:45

标签: windows powershell chef

尝试使用Chef和Chocolatey cookbook首次安装Chocolatey时,我收到了关于我的chef-zero配置运行的消息:

WARNING: It's very likely you will need to close and reopen your shell

当我需要安装我在Chocolatey食谱的属性文件中列出的应用时,它会因为命令" choco"而失败。无法找到。当我第二次提供时,一切正常。

我试图在Chocolatey食谱中重新启动powershell但是失败了。我想知道是否还有其他人遇到过此问题以及是否有解决方法。

以下是STDERR的输出:

==> default:     STDOUT:
==> default:     STDERR: C:\Users\vagrant\AppData\Local\Temp\chef-script20160425-2280-k20yic.ps1 : The
==> default:
==> default:     term 'choco' is not recognized as the name of a cmdlet, function, script file,
==> default:
==> default:     or operable program. Check the spelling of the name, or if a path was
==> default:
==> default:     included, verify that the path is correct and try again.
==> default:
==> default:         + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
==> default:
==> default:        tion
==> default:
==> default:         + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
==> default:
==> default:        n,chef-script20160425-2280-k20yic.ps1
==> default:     ---- End output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/vagrant/AppData/Local/Temp/chef-script20160425-2280-k20yic.ps1" ----
==> default:     Ran "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/vagrant/AppData/Local/Temp/chef-script20160425-2280-k20yic.ps1" returned 1

1 个答案:

答案 0 :(得分:-1)

如警告所示,您需要重新启动shell或其他进程以获取对$PATH的全局修改。