Skip to content

Instantly share code, notes, and snippets.

@atorralb
Created November 18, 2015 02:49
Show Gist options
  • Save atorralb/c83272436bb99f52d048 to your computer and use it in GitHub Desktop.
Save atorralb/c83272436bb99f52d048 to your computer and use it in GitHub Desktop.
Script to delete System Restore Points
#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