chocolatey/chocolatey-cookbook — pull request #13 by tyrken (2014-04-02 17:08:42+00:00)
Title: Switch from "execute" to "batch" resource to ensure 64-bit environment

I think this should fix issue #9, by forcing the use of the correct bitness of powershell, the same as you'd get by default interactively. Otherwise 32-bit ruby will run a 32-bit command prompt/powershell on a 64-bit box and so break some packaging scripts or DISM callers.

I thought this route slightly simpler than juliandunn's suggestion to use locate_sysnative_cmd, but both perform the same job. Neither can help when using Mixlib::ShellOut to get the stdout from a chocolatey call, but as that's only ever used for querying versions and not doing actual installs/uninstalls, I think we're safe.