Fix shell provisioner to execute batch files correctly
Call cmd.exe explicitly when running batch files to easily manage special characters that may be within the path. Fixes #8535
This commit is contained in:
parent
a018eec3e7
commit
71bfe7c884
|
@ -191,8 +191,11 @@ module VagrantPlugins
|
||||||
shell_args += " -OutputFormat Text" if config.powershell_args !~ /[-\/]OutputFormat/i
|
shell_args += " -OutputFormat Text" if config.powershell_args !~ /[-\/]OutputFormat/i
|
||||||
|
|
||||||
command = "\"#{exec_path}\"#{args}"
|
command = "\"#{exec_path}\"#{args}"
|
||||||
command = "powershell #{shell_args.to_s} -file #{command}" if
|
if File.extname(exec_path).downcase == ".ps1"
|
||||||
File.extname(exec_path).downcase == '.ps1'
|
command = "powershell #{shell_args.to_s} -file #{command}"
|
||||||
|
else
|
||||||
|
command = "cmd /q /c #{command}"
|
||||||
|
end
|
||||||
|
|
||||||
# Append the environment
|
# Append the environment
|
||||||
if !env.empty?
|
if !env.empty?
|
||||||
|
|
Loading…
Reference in New Issue