When trying to install Chocolatey for the first time using Chef and the Chocolatey cookbook I get the message on my chef-zero provisioning run:
WARNING: It's very likely you will need to close and reopen your shell
When it comes time to install the apps I've listed in my attributes file for the Chocolatey cookbook, it fails because the command "choco" cannot be found. When I provision a second time everything works fine.
I've tried to restart powershell within the Chocolatey cookbook but that fails. I was wondering if anyone else has ran into this and if there is a work around.
Here is the output of the 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