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