mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 10:19:36 -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"
|
& 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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user