diff --git a/plugins/communicators/winrm/communicator.rb b/plugins/communicators/winrm/communicator.rb index 5ce188229..7609f16b3 100644 --- a/plugins/communicators/winrm/communicator.rb +++ b/plugins/communicators/winrm/communicator.rb @@ -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"])