lib/kitchen/driver/powershell.rb in kitchen-hyperv-0.1.6 vs lib/kitchen/driver/powershell.rb in kitchen-hyperv-0.1.7

- old
+ new

@@ -25,11 +25,20 @@ def encode_command(script) encoded_script = script.encode('UTF-16LE', 'UTF-8') Base64.strict_encode64(encoded_script) end + def is_64bit? + os_arch = ENV['PROCESSOR_ARCHITEW6432'] || ENV['PROCESSOR_ARCHITECTURE'] + os_arch == 'AMD64' + end + def powershell_64_bit - 'c:\windows\sysnative\windowspowershell\v1.0\powershell.exe' + if is_64bit? + 'c:\windows\system32\windowspowershell\v1.0\powershell.exe' + else + 'c:\windows\sysnative\windowspowershell\v1.0\powershell.exe' + end end def wrap_command(script) base_script_path = File.join(File.dirname(__FILE__), '/../../../support/hyperv.ps1') debug("Loading functions from #{base_script_path}")