added the -cleanup to the checkbox

This commit is contained in:
2025-11-23 17:49:15 -05:00
parent 4d422a6b43
commit 8a148bf479

View File

@@ -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 {