mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-06-05 21:02:51 +08:00
Clean up comments and update system restore point apply text
This commit is contained in:
parent
ec5073b7ca
commit
c09d5d3864
@ -6,7 +6,6 @@ function CreateSystemRestorePoint {
|
||||
# In GUI mode, skip the prompt and just try to enable it
|
||||
if ($script:GuiWindow -or $Silent -or $( Read-Host -Prompt "System restore is disabled, would you like to enable it and create a restore point? (y/n)") -eq 'y') {
|
||||
try {
|
||||
# Changed it from 20 seconds to 90 for slow computers, and maybe 120 is great
|
||||
$enableResult = Invoke-NonBlocking -TimeoutSeconds 90 -ScriptBlock {
|
||||
try {
|
||||
Enable-ComputerRestore -Drive "$env:SystemDrive"
|
||||
@ -34,7 +33,6 @@ function CreateSystemRestorePoint {
|
||||
|
||||
if (-not $failed) {
|
||||
try {
|
||||
# Changed it from 20 seconds to 90 for slow computers, and maybe 120 is great
|
||||
$result = Invoke-NonBlocking -TimeoutSeconds 90 -ScriptBlock {
|
||||
try {
|
||||
$recentRestorePoints = Get-ComputerRestorePoint | Where-Object { (Get-Date) - [System.Management.ManagementDateTimeConverter]::ToDateTime($_.CreationTime) -le (New-TimeSpan -Hours 24) }
|
||||
|
||||
@ -166,7 +166,7 @@ function ExecuteAllChanges {
|
||||
if ($hasRegistryBackedFeature) {
|
||||
$currentStep++
|
||||
if ($script:ApplyProgressCallback) {
|
||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating registry backup"
|
||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating registry backup..."
|
||||
}
|
||||
|
||||
Write-Host "> Creating registry backup..."
|
||||
@ -182,9 +182,9 @@ function ExecuteAllChanges {
|
||||
if ($script:Params.ContainsKey("CreateRestorePoint")) {
|
||||
$currentStep++
|
||||
if ($script:ApplyProgressCallback) {
|
||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating system restore point"
|
||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating system restore point, this may take a moment..."
|
||||
}
|
||||
Write-Host "> Attempting to create a system restore point..."
|
||||
Write-Host "> Creating a system restore point..."
|
||||
CreateSystemRestorePoint
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user