Merge pull request #378 from iambdud/add-try-catch-for-creating-vm

adding a simple try/catch for cases where the VM fails to start
This commit is contained in:
rbalsleyMSFT
2026-05-29 15:39:06 -07:00
committed by GitHub
+7 -1
View File
@@ -3248,7 +3248,13 @@ function New-FFUVM {
& vmconnect localhost "$VMName" & vmconnect localhost "$VMName"
#Start VM #Start VM
Start-VM -Name $VMName try{
Start-VM -Name $VMName -ErrorAction Stop
}
catch{
WriteLog "Error starting VM: $_"
throw $_
}
return $VM return $VM
} }