シェルを閉じてから再度開く必要があります非常に可能性があります:Chocolateyインストール:WARNING:それはあなたがシェフと<a href="https://github.com/chocolatey/chocolatey-cookbook" rel="nofollow">Chocolatey cookbook</a>を使用して初めてChocolateyをインストールしようとしたとき、私は私のシェフゼロプロビジョニング実行時にメッセージが表示されます
WARNING: It's very likely you will need to close and reopen your shell
を
Chocolatey cookbookのアトリビュートファイルにリストアップしたアプリケーションをインストールするときは、コマンド "choco"が見つからないので失敗します。私が2回目のプロビジョニングをするとき、すべてがうまく動作します
Chocolatey cookbook内で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
ゴールデンイメージにチョコレートをまとめるのが一般的です。失敗する理由は、chocolateyディレクトリが$ PATHの一部ではないためです。この質問を参照してください:http://stackoverflow.com/questions/6284517/how-can-you-use-a-chef-recipe-to-set-an-environment-variableとこの質問:http://stackoverflow.com/a/17851541/1626687 – spuder