Fixes 4309

When the winrm communicator executes a command in an elevated shell,
this patch causes it to escape double quotes.

This is necessary as the first line in the file that it produces and
then executes it puts the command into a variable called command that
is delimited by double quotes.
This commit is contained in:
William E. Triest. III 2014-08-07 08:49:36 -04:00
parent a08d9078da
commit 4a2566c646
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ module VagrantPlugins
script = Vagrant::Util::TemplateRenderer.render(path, options: {
username: shell.username,
password: shell.password,
command: command,
command: command.gsub("\"", "`\""),
})
guest_script_path = "c:/tmp/vagrant-elevated-shell.ps1"
file = Tempfile.new(["vagrant-elevated-shell", "ps1"])