mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-05-18 11:46:18 +00:00
Merge branch 'master' of https://github.com/Raphire/Win11Debloat
This commit is contained in:
@@ -6,7 +6,7 @@ function CreateSystemRestorePoint {
|
|||||||
# In GUI mode, skip the prompt and just try to enable it
|
# 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') {
|
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 {
|
try {
|
||||||
$enableResult = Invoke-NonBlocking -TimeoutSeconds 20 -ScriptBlock {
|
$enableResult = Invoke-NonBlocking -TimeoutSeconds 90 -ScriptBlock {
|
||||||
try {
|
try {
|
||||||
Enable-ComputerRestore -Drive "$env:SystemDrive"
|
Enable-ComputerRestore -Drive "$env:SystemDrive"
|
||||||
return $null
|
return $null
|
||||||
@@ -33,7 +33,7 @@ function CreateSystemRestorePoint {
|
|||||||
|
|
||||||
if (-not $failed) {
|
if (-not $failed) {
|
||||||
try {
|
try {
|
||||||
$result = Invoke-NonBlocking -TimeoutSeconds 20 -ScriptBlock {
|
$result = Invoke-NonBlocking -TimeoutSeconds 90 -ScriptBlock {
|
||||||
try {
|
try {
|
||||||
$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) }
|
||||||
}
|
}
|
||||||
@@ -92,4 +92,4 @@ function CreateSystemRestorePoint {
|
|||||||
|
|
||||||
Write-Host "Warning: Continuing without restore point" -ForegroundColor Yellow
|
Write-Host "Warning: Continuing without restore point" -ForegroundColor Yellow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ function ExecuteAllChanges {
|
|||||||
if ($hasRegistryBackedFeature) {
|
if ($hasRegistryBackedFeature) {
|
||||||
$currentStep++
|
$currentStep++
|
||||||
if ($script:ApplyProgressCallback) {
|
if ($script:ApplyProgressCallback) {
|
||||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating registry backup"
|
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating registry backup..."
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "> Creating registry backup..."
|
Write-Host "> Creating registry backup..."
|
||||||
@@ -182,9 +182,9 @@ function ExecuteAllChanges {
|
|||||||
if ($script:Params.ContainsKey("CreateRestorePoint")) {
|
if ($script:Params.ContainsKey("CreateRestorePoint")) {
|
||||||
$currentStep++
|
$currentStep++
|
||||||
if ($script:ApplyProgressCallback) {
|
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
|
CreateSystemRestorePoint
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user