diff --git a/config/software/chef-windows.rb b/config/software/chef-windows.rb
index <HASH>..<HASH> 100644
--- a/config/software/chef-windows.rb
+++ b/config/software/chef-windows.rb
@@ -89,5 +89,9 @@ build do
        "-n #{install_dir}/bin",
        "--no-rdoc --no-ri"].join(" ")
 
-  bundle "install", :env => { "PATH" => "#{install_dir}/embedded/bin;#{install_dir}/embedded/mingw/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"}
+  # Depending on which shell is being used, the path environment variable can
+  # be "PATH" or "Path". If *both* are set, only one is honored.
+  path_key = ENV.keys.grep(/\Apath\Z/i).first
+
+  bundle "install", :env => { path_key => "#{install_dir}\\embedded\\bin;#{install_dir}\\embedded\\mingw\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem"}
 end
Workaround issue cause by conflicting PATH environment variables

cmd.exe can have both a PATH and a Path environment variable; setting both
causes unpredictable behavior. We work around this by detecting the
correct path variable to override in shell_out commands.