Skip to content

Commit f6714be

Browse files
author
Kartik Null Cating-Subramanian
committed
Invoke the correct powershell on 64-bit windows.
1 parent e97f74f commit f6714be

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/kitchen/driver/powershell.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ def encode_command(script)
2727
Base64.strict_encode64(encoded_script)
2828
end
2929

30+
def is_64bit?
31+
os_arch = ENV['PROCESSOR_ARCHITEW6432'] || ENV['PROCESSOR_ARCHITECTURE']
32+
os_arch == 'AMD64'
33+
end
34+
3035
def powershell_64_bit
31-
'c:\windows\sysnative\windowspowershell\v1.0\powershell.exe'
36+
if is_64bit?
37+
'c:\windows\system32\windowspowershell\v1.0\powershell.exe'
38+
else
39+
'c:\windows\sysnative\windowspowershell\v1.0\powershell.exe'
40+
end
3241
end
3342

3443
def wrap_command(script)

0 commit comments

Comments
 (0)