Merge pull request #4383 from mwrock/error
communicators/winrm: handle errors that do not set an exit code
This commit is contained in:
commit
069230a563
|
@ -54,7 +54,7 @@ module VagrantPlugins
|
||||||
def powershell(command, &block)
|
def powershell(command, &block)
|
||||||
# ensure an exit code
|
# ensure an exit code
|
||||||
command << "\r\n"
|
command << "\r\n"
|
||||||
command << "if ($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 0 }"
|
command << "if ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }"
|
||||||
execute_shell(command, :powershell, &block)
|
execute_shell(command, :powershell, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue