mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
adding a simple try/catch for cases where the VM fails to start
This commit is contained in:
@@ -3049,7 +3049,13 @@ function New-FFUVM {
|
||||
& vmconnect localhost "$VMName"
|
||||
|
||||
#Start VM
|
||||
Start-VM -Name $VMName
|
||||
try{
|
||||
Start-VM -Name $VMName -ErrorAction Stop
|
||||
}
|
||||
catch{
|
||||
WriteLog "Error starting VM: $_"
|
||||
throw $_
|
||||
}
|
||||
|
||||
return $VM
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user