Bring-Back-#3710 (#3809)

* Update WPFTweaksRestorePoint

* Update tweaks.json

* Fix PowerShell script syntax in tweaks.json

* Update tweaks.json
This commit is contained in:
Gabi
2026-01-07 21:56:49 +02:00
committed by GitHub
parent 69d8649986
commit 158fabd31e

View File

@@ -1932,46 +1932,23 @@
"panel": "1", "panel": "1",
"Checked": "False", "Checked": "False",
"Order": "a001_", "Order": "a001_",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore",
"Name": "SystemRestorePointCreationFrequency",
"Type": "DWord",
"Value": "0",
"OriginalValue": "1440"
}
],
"InvokeScript": [ "InvokeScript": [
" "
# Check if System Restore is enabled for the main drive if (-not (Get-ComputerRestorePoint)) {
try { Enable-ComputerRestore -Drive $Env:SystemDrive
# Try getting restore points to check if System Restore is enabled }
Enable-ComputerRestore -Drive \"$env:SystemDrive\"
} catch { Checkpoint-Computer -Description \"System Restore Point created by WinUtil\" -RestorePointType MODIFY_SETTINGS
Write-Host \"An error occurred while enabling System Restore: $_\" Write-Host \"System Restore Point Created Successfully\" -ForegroundColor Green
}
# Check if the SystemRestorePointCreationFrequency value exists
$exists = Get-ItemProperty -path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -ErrorAction SilentlyContinue
if($null -eq $exists) {
write-host 'Changing system to allow multiple restore points per day'
Set-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\" -Name \"SystemRestorePointCreationFrequency\" -Value \"0\" -Type DWord -Force -ErrorAction Stop | Out-Null
}
# Attempt to load the required module for Get-ComputerRestorePoint
try {
Import-Module Microsoft.PowerShell.Management -ErrorAction Stop
} catch {
Write-Host \"Failed to load the Microsoft.PowerShell.Management module: $_\"
return
}
# Get all the restore points for the current day
try {
$existingRestorePoints = Get-ComputerRestorePoint | Where-Object { $_.CreationTime.Date -eq (Get-Date).Date }
} catch {
Write-Host \"Failed to retrieve restore points: $_\"
return
}
# Check if there is already a restore point created today
if ($existingRestorePoints.Count -eq 0) {
$description = \"System Restore Point created by WinUtil\"
Checkpoint-Computer -Description $description -RestorePointType \"MODIFY_SETTINGS\"
Write-Host -ForegroundColor Green \"System Restore Point Created Successfully\"
}
" "
], ],
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/restorepoint" "link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/restorepoint"