Created
November 18, 2015 02:49
-
-
Save atorralb/c83272436bb99f52d048 to your computer and use it in GitHub Desktop.
Script to delete System Restore Points
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
#example usage: | |
#"simulate" the deletion of all available System Restore Points | |
Get-ComputerRestorePoint | Delete-ComputerRestorePoint -WhatIf | |
#delete all System Restore Points older than 14 days | |
$removeDate = (Get-Date).AddDays(-14) | |
Get-ComputerRestorePoint | | |
Where { $_.ConvertToDateTime($_.CreationTime) -lt $removeDate } | | |
Delete-ComputerRestorePoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment