diff options
author | Salim Alam <salam@chef.io> | 2015-08-13 14:25:48 -0700 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2015-08-19 11:08:17 -0700 |
commit | 6c4cd5c6d5c40baca723bf95cdbccdda59021198 (patch) | |
tree | f2d6357705440c11467b46c60eac0b4c5ddb871e /lib/chef/provider/powershell_script.rb | |
parent | fe6676bab51390429674b0ecd4670924ffb09cc5 (diff) | |
download | chef-6c4cd5c6d5c40baca723bf95cdbccdda59021198.tar.gz |
Enable 64-bit support for Powershell and Batch scripts
Diffstat (limited to 'lib/chef/provider/powershell_script.rb')
-rw-r--r-- | lib/chef/provider/powershell_script.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index 3c52db1f33..004b182769 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -34,6 +34,15 @@ class Chef super end + def command + basepath = is_forced_32bit ? wow64_directory : run_context.node.kernel.os_info.system_directory + + # Powershell.exe is always in "v1.0" folder (for backwards compatibility) + interpreter_path = Chef::Util::PathHelper.join(basepath, "WindowsPowerShell", "v1.0", interpreter) + + "\"#{interpreter_path}\" #{flags} \"#{script_file.path}\"" + end + def flags # Must use -File rather than -Command to launch the script # file created by the base class that contains the script |