From 2620042c264709a7e0f4cb80f3d18412c55ec9b3 Mon Sep 17 00:00:00 2001 From: Tomas Srnka Date: Sun, 4 Jan 2015 00:05:50 +0100 Subject: [PATCH] Fix catching "Start-VM" exceptions on Hyper-V during starting up VM --- plugins/providers/hyperv/scripts/start_vm.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/providers/hyperv/scripts/start_vm.ps1 b/plugins/providers/hyperv/scripts/start_vm.ps1 index 937ce75ed..54025c9a4 100644 --- a/plugins/providers/hyperv/scripts/start_vm.ps1 +++ b/plugins/providers/hyperv/scripts/start_vm.ps1 @@ -10,7 +10,7 @@ forEach ($module in $modules) { . $module } try { $vm = Get-VM -Id $VmId -ErrorAction "stop" - Start-VM $vm + Start-VM $vm -ErrorAction "stop" $state = $vm.state $status = $vm.status $name = $vm.name @@ -24,4 +24,4 @@ try { } catch { Write-Error-Message "Failed to start a VM $_" -} +} \ No newline at end of file