From 8a148bf479410f98889b79754d63059c9a66703f Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 23 Nov 2025 17:49:15 -0500 Subject: [PATCH] added the -cleanup to the checkbox --- Scriptmonkey_Beta.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Scriptmonkey_Beta.ps1 b/Scriptmonkey_Beta.ps1 index 1256a7b..93befd5 100644 --- a/Scriptmonkey_Beta.ps1 +++ b/Scriptmonkey_Beta.ps1 @@ -1780,12 +1780,18 @@ function Handle-CleanupSVSMSP { param($Context) try { - if (Get-Command Cleanup-SVSMSP -ErrorAction Stop) { - Cleanup-SVSMSP - Write-LogHybrid "SVSMSP toolkit cleanup complete" Success OffBoard -LogToEvent + if (Get-Command Install-SVSMSP -ErrorAction Stop) { + # This will: + # - Uninstall SVSMSP + # - Unregister SVS_Repo + # - Remove SVSMSP from the session + # - Delete HKLM:\Software\SVS\Deployment (via Remove-SVSDeploymentRegKey) + Install-SVSMSP -Cleanup + + Write-LogHybrid "SVSMSP toolkit cleanup complete (module, repo, registry)." Success OffBoard -LogToEvent Respond-Text $Context "SVSMSP toolkit cleanup complete." } else { - throw "Cleanup-SVSMSP cmdlet not found in SVSMSP toolkit." + throw "Install-SVSMSP function not found in current session." } } catch {