diff --git a/cleanup.ps1 b/cleanup.ps1 index 6580cf7..856a518 100644 --- a/cleanup.ps1 +++ b/cleanup.ps1 @@ -76,7 +76,15 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) { exit } - # Send webhook + # Generate the restore point name + # Format: QUEST-CLEANUP--<6_RANDOM>- + $randomChars = -join ((65..90) + (97..122) + (48..57) | Get-Random -Count 6 | ForEach-Object {[char]$_}) + $dateStr = Get-Date -Format "yyyy-MM-dd" + + # Set the $Name variable for the external script to use + $Name = "QUEST-CLEANUP-$ticket-$randomChars-$dateStr" + + # Webhook try { $CreateRestorePoint = irm $ScriptCreateRestorePoint | iex $GetComputerInfo = irm $ScriptGetComputerInfo | iex