diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 52f4b45..92c3d1a 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -756,8 +756,14 @@ function CreateSystemRestorePoint { } if ($recentRestorePoints.Count -eq 0) { - Checkpoint-Computer -Description "Restore point created by Win11Debloat" -RestorePointType "MODIFY_SETTINGS" - Write-Output "System restore point created successfully" + + try { + Checkpoint-Computer -Description "Restore point created by Win11Debloat" -RestorePointType "MODIFY_SETTINGS" + Write-Output "System restore point created successfully" + } catch { + Write-Host "Error: Unable to create restore point: $_" -ForegroundColor Red + return + } } else { Write-Host "A recent restore point already exists, no new restore point was created." -ForegroundColor Yellow