Merge pull request #10181 from chrisroberts/f-auto-checkpoints

Check for automatic checkpoint support before configuring
This commit is contained in:
Brian Cain 2018-09-07 10:44:26 -07:00 committed by GitHub
commit 6c8d997053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -106,6 +106,11 @@ if($EnableAutomaticCheckpoints) {
} }
try { try {
if($autochecks -eq 1 -and (Get-Command Hyper-V\Set-VM).Parameters["AutomaticCheckpointsEnabled"] -eq $null) {
Write-ErrorMessage "AutomaticCheckpointsEnabled is not available"
exit 1
}
Hyper-V\Set-VM -VM $VM -AutomaticCheckpointsEnabled $autochecks Hyper-V\Set-VM -VM $VM -AutomaticCheckpointsEnabled $autochecks
} catch { } catch {
Write-ErrorMessage "Failed to ${AutoAction} automatic checkpoints on VM: ${PSItem}" Write-ErrorMessage "Failed to ${AutoAction} automatic checkpoints on VM: ${PSItem}"