mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Remove prompts after system restore creation errors
This commit is contained in:
@@ -851,7 +851,6 @@ function CreateSystemRestorePoint {
|
|||||||
Enable-ComputerRestore -Drive "$env:SystemDrive"
|
Enable-ComputerRestore -Drive "$env:SystemDrive"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Error: Failed to enable System Restore: $_" -ForegroundColor Red
|
Write-Host "Error: Failed to enable System Restore: $_" -ForegroundColor Red
|
||||||
Write-Output ""
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -860,9 +859,6 @@ function CreateSystemRestorePoint {
|
|||||||
|
|
||||||
if (-not $enableSystemRestoreJobDone) {
|
if (-not $enableSystemRestoreJobDone) {
|
||||||
Write-Host "Error: Failed to enable system restore and create restore point, operation timed out" -ForegroundColor Red
|
Write-Host "Error: Failed to enable system restore and create restore point, operation timed out" -ForegroundColor Red
|
||||||
Write-Output ""
|
|
||||||
Write-Output "Press any key to continue anyway..."
|
|
||||||
$null = [System.Console]::ReadKey()
|
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
Receive-Job $enableSystemRestoreJob
|
Receive-Job $enableSystemRestoreJob
|
||||||
@@ -879,7 +875,6 @@ function CreateSystemRestorePoint {
|
|||||||
$recentRestorePoints = Get-ComputerRestorePoint | Where-Object { (Get-Date) - [System.Management.ManagementDateTimeConverter]::ToDateTime($_.CreationTime) -le (New-TimeSpan -Hours 24) }
|
$recentRestorePoints = Get-ComputerRestorePoint | Where-Object { (Get-Date) - [System.Management.ManagementDateTimeConverter]::ToDateTime($_.CreationTime) -le (New-TimeSpan -Hours 24) }
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Error: Unable to retrieve existing restore points: $_" -ForegroundColor Red
|
Write-Host "Error: Unable to retrieve existing restore points: $_" -ForegroundColor Red
|
||||||
Write-Output ""
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,9 +894,6 @@ function CreateSystemRestorePoint {
|
|||||||
|
|
||||||
if (-not $createRestorePointJobDone) {
|
if (-not $createRestorePointJobDone) {
|
||||||
Write-Host "Error: Failed to create system restore point, operation timed out" -ForegroundColor Red
|
Write-Host "Error: Failed to create system restore point, operation timed out" -ForegroundColor Red
|
||||||
Write-Output ""
|
|
||||||
Write-Output "Press any key to continue anyway..."
|
|
||||||
$null = [System.Console]::ReadKey()
|
|
||||||
} else {
|
} else {
|
||||||
Receive-Job $createRestorePointJob
|
Receive-Job $createRestorePointJob
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user