Merge pull request #10265 from chrisroberts/f-win-chktyp
Only configure CheckpointType if available to be configured.
This commit is contained in:
commit
080dd748ef
|
@ -91,7 +91,14 @@ if($EnableCheckpoints) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Hyper-V\Set-VM -VM $VM -CheckpointType $checkpoints
|
if((Get-Command Hyper-V\Set-VM).Parameters["CheckpointType"] -eq $null) {
|
||||||
|
if($CheckpointAction -eq "enable") {
|
||||||
|
Write-ErrorMessage "CheckpointType is not available. Cannot enable checkpoints."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Hyper-V\Set-VM -VM $VM -CheckpointType $checkpoints
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
Write-ErrorMessage "Failed to ${CheckpointAction} checkpoints on VM: ${PSItem}"
|
Write-ErrorMessage "Failed to ${CheckpointAction} checkpoints on VM: ${PSItem}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue