From 2ab6f7bfe7edb0fcb2f24b3a236fc5c0f68a1960 Mon Sep 17 00:00:00 2001 From: Joeri Date: Fri, 20 Feb 2026 16:29:42 +0100 Subject: [PATCH] Updated --- create_restorepoint.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/create_restorepoint.ps1 b/create_restorepoint.ps1 index 4f3e25c..a0f45f2 100644 --- a/create_restorepoint.ps1 +++ b/create_restorepoint.ps1 @@ -1,20 +1,23 @@ # Check if a Name variable was passed from the calling script -# If not, generate a default name (e.g., for manual use or other scripts) if (-not $Name) { $Name = "RestorePoint-$(Get-Date -Format 'yyyy-MM-dd-HHmmss')" } +# Define the RestorePointType +# Use APPLICATION_INSTALL for cleanup tasks (treats it like an "install" that can be rolled back) +$restorePointType = "MODIFY_SETTINGS" + try { - # Create the restore point using the $Name variable - Checkpoint-Computer -Description $Name -RestorePointType "Application" -ErrorAction Stop + Checkpoint-Computer -Description $Name -RestorePointType $restorePointType -ErrorAction Stop $status = "Success" } catch { $status = "Failed: $($_.Exception.Message)" } -# Return the result as JSON (the main script expects JSON) +# Return the result as JSON @{ Name = $Name + RestorePointType = $restorePointType Status = $status Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" } | ConvertTo-Json \ No newline at end of file