-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix Restore Points before tweaks * Compile Winutil * Update Set-WinUtilRestorePoint.ps1 * Compile Winutil * add snappy driver installer origin (#936) * fix when User name have space (#937) * Compile Winutil * Add Applications (Fixed) (#944) * Add Applications (Fixed) This fixes #940 by removing OperaGX, fixing alphabetization, and removing my instance of Neovim which I didn't notice was added recently. * Update winutil.ps1 * Update inputXML.xaml --------- Co-authored-by: Chris Titus <[email protected]> * Compile Winutil * removing service stops in services tweak * Fix pin not working for microsoft accounts * Compile Winutil * Remove verbose code * Compile Winutil --------- Co-authored-by: ChrisTitusTech <[email protected]> Co-authored-by: Padsala Tushal <[email protected]> Co-authored-by: AdamJedl <[email protected]> Co-authored-by: AshlynOrSomethin <[email protected]>
- Loading branch information
1 parent
2321c07
commit cfb04b5
Showing
8 changed files
with
130 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function Set-WinUtilRestorePoint { | ||
<# | ||
.DESCRIPTION | ||
This function will make a Restore Point | ||
#> | ||
|
||
# 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 | ||
Enable-ComputerRestore -Drive "$env:SystemDrive" | ||
} catch { | ||
Write-Host "An error occurred while enabling System Restore: $_" | ||
} | ||
|
||
# Get all the restore points for the current day | ||
$existingRestorePoints = Get-ComputerRestorePoint | Where-Object { $_.CreationTime.Date -eq (Get-Date).Date } | ||
|
||
# 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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.