added the cleanup switch

This commit is contained in:
2025-06-29 14:01:10 -04:00
parent cf8affac63
commit 80af2d87ae

View File

@@ -75,9 +75,12 @@
# → writes datto_sites.csv
.EXAMPLE
Before i built the Invoke-scriptmonkey
& ([ScriptBlock]::Create((iwr 'sm.svstools.ca').Content )) -SilentInstall
.EXAMPLE
& ([ScriptBlock]::Create((iwr 'sm.svstools.com').Content)) -Cleanup
.EXAMPLE
not tested but i thin this is how would call it
iex (iwr 'https://your.server/ScriptMonkey.ps1' -UseBasicParsing).Content; Invoke-ScriptMonkey -DattoApiUrl
@@ -102,6 +105,11 @@
# ─────────────────────────────────────────────────────────
# Toolkit-only mode
[Parameter(Mandatory,ParameterSetName='Toolkit')][switch]$SilentInstall,
# ─────────────────────────────────────────────────────────
# remove Toolkit
[Parameter(Mandatory,ParameterSetName='Cleanup')][switch]$Cleanup,
# ─────────────────────────────────────────────────────────
# Datto headless mode
@@ -138,6 +146,12 @@
return
}
'Cleanup' {
Write-LogHybrid "Running Toolkit cleanup mode" Info Startup
Install-SVSMSP -Cleanup
return
}
# ───────────────────────────────────────────────────────────
# 2) If user only wants the site list, do that and exit
# ───────────────────────────────────────────────────────────