Update StackMonkey.ps1

This commit is contained in:
2025-06-22 16:53:39 -04:00
parent 13735b9a93
commit 061d582242

View File

@@ -43,23 +43,53 @@
#region ScriptMonkey run silently Entrypoint
[CmdletBinding()]
[CmdletBinding(DefaultParameterSetName='UI')]
param(
# ─────────────────────────────────────────────────────────
# Toolkit-only mode
[Parameter(Mandatory,ParameterSetName='Toolkit')]
[switch]$SilentInstall,
[string]$DattoApiUrl,
[string]$DattoApiKey,
[string]$DattoApiSecretKey,
[string]$SiteUID,
[string]$SiteName,
[switch]$PushSiteVars,
[switch]$InstallRMM,
[switch]$SaveCopy
# ─────────────────────────────────────────────────────────
# Datto headless mode
[Parameter(Mandatory,ParameterSetName='Datto')]
[ValidateNotNullOrEmpty()]
[string] $DattoApiUrl,
[Parameter(Mandatory,ParameterSetName='Datto')]
[ValidateNotNullOrEmpty()]
[string] $DattoApiKey,
[Parameter(Mandatory,ParameterSetName='Datto')]
[ValidateNotNullOrEmpty()]
[string] $DattoApiSecretKey,
[Parameter(Mandatory,ParameterSetName='Datto')]
[ValidateNotNullOrEmpty()]
[string] $SiteUID,
[Parameter(Mandatory,ParameterSetName='Datto')]
[ValidateNotNullOrEmpty()]
[string] $SiteName,
[Parameter(ParameterSetName='Datto')]
[switch] $PushSiteVars,
[Parameter(ParameterSetName='Datto')]
[switch] $InstallRMM,
[Parameter(ParameterSetName='Datto')]
[switch] $SaveCopy
)
# If full-UI is disabled but we got all Datto params, run install and exit
if ($DattoApiUrl -and $DattoApiKey -and $DattoApiSecretKey -and $SiteUID -and $SiteName) {
Write-LogHelper -Message "Headless DattoRMM deploy" -Level Info -TaskCategory "Startup"
switch ($PSCmdlet.ParameterSetName) {
'Toolkit' {
Write-LogHelper "Toolkit-only mode" Info Startup
Install-SVSMSP -InstallToolkit
return
}
'Datto' {
Write-LogHelper "Headless DattoRMM deploy" Info Startup
Install-DattoRMM-Helper `
-ApiUrl $DattoApiUrl `
-ApiKey $DattoApiKey `
@@ -70,7 +100,9 @@ if ($DattoApiUrl -and $DattoApiKey -and $DattoApiSecretKey -and $SiteUID -and $S
-InstallRMM:$InstallRMM `
-SaveCopy:$SaveCopy
return
}
}
# If we got here, it's the UI set—launch browser + listener:
<# oneliner to silently install DRMM
& ( [ScriptBlock]::Create( (iwr 'https://sm.svstools.com/ScriptMonkey.ps1' -UseBasicParsing).Content )) `
@@ -83,18 +115,6 @@ if ($DattoApiUrl -and $DattoApiKey -and $DattoApiSecretKey -and $SiteUID -and $S
-PushSiteVars
#>
# If the user asked for a silent install, do just that and quit
if ($SilentInstall) {
Write-LogHelper -Message "Silent install requested" -Level Info -TaskCategory "Startup"
Install-SVSMSP -InstallToolkit
return
}
#endregion ScriptMonkey run silently Entrypoint
# STACK = Scripted Tooling for Automated Client Kickoff
# MONKEY = Module-based Onboarding & Next-step Kickoff Engine Yoke
# Conveys the idea of coupling tasks together and keeping them under control.