The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
## Description
Creates a restore point at runtime in case a revert is needed from WinUtil modifications
<!-- BEGIN CUSTOM CONTENT -->
<!-- END CUSTOM CONTENT -->
<details>
<summary>Preview Code</summary>
```json
{
"Content": "Create Restore Point",
"Description": "Creates a restore point at runtime in case a revert is needed from WinUtil modifications",
"category": "Essential Tweaks",
"panel": "1",
"Checked": "False",
"Order": "a001_",
"InvokeScript": [
"
# Check if the user has administrative privileges
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host \"Please run this script as an administrator.\"
return
}
# Check if System Restore is enabled for the main drive
try {
# Try getting restore points to check if System Restore is enabled
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Please run this script as an administrator."
return
}
# Check if System Restore is enabled for the main drive
try {
# Try getting restore points to check if System Restore is enabled
Enable-ComputerRestore -Drive "$env:SystemDrive"
} catch {
Write-Host "An error occurred while enabling System Restore: $_"
}
# Check if the SystemRestorePointCreationFrequency value exists