Merge pull request #8539 from chrisroberts/fix/win-prov-bat

Fix shell provisioner to execute batch files correctly
This commit is contained in:
Chris Roberts 2017-05-01 13:31:46 -07:00 committed by GitHub
commit 1c00aa3d98
1 changed files with 5 additions and 2 deletions

View File

@ -191,8 +191,11 @@ module VagrantPlugins
shell_args += " -OutputFormat Text" if config.powershell_args !~ /[-\/]OutputFormat/i
command = "\"#{exec_path}\"#{args}"
command = "powershell #{shell_args.to_s} -file #{command}" if
File.extname(exec_path).downcase == '.ps1'
if File.extname(exec_path).downcase == ".ps1"
command = "powershell #{shell_args.to_s} -file #{command}"
else
command = "cmd /q /c #{command}"
end
# Append the environment
if !env.empty?