Fix two bugs in WinSSH -- a hang when executing powershell via SSH, and when cmd shell is default renaming computer was attempting to execute powershell commands via a batch script

This commit is contained in:
Z. Cliffe Schreuders 2019-09-16 10:01:25 +01:00
parent b28e6d95a6
commit 29e741c30c
2 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,7 @@ module VagrantPlugins
remote_name = "#{machine_config_ssh.upload_directory}\\#{File.basename(tfile.path)}.#{remote_ext}"
if shell == "powershell"
base_cmd = "powershell -File #{remote_name}"
base_cmd = "powershell -File #{remote_name} -InputFormat None"
tfile.puts <<-SCRIPT.force_encoding('ASCII-8BIT')
Remove-Item #{remote_name}
Write-Host #{CMD_GARBAGE_MARKER}

View File

@ -23,7 +23,8 @@ module VagrantPlugins
machine.communicate.execute(
script,
error_class: Errors::RenameComputerFailed,
error_key: :rename_computer_failed)
error_key: :rename_computer_failed,
shell: "powershell")
machine.guest.capability(:reboot)
end