From 422491b7ee7b96ae0fe8a8775c556d743bd43126 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 22 Jun 2025 16:18:48 -0400 Subject: [PATCH] added silent DattoRMM install --- StackMonkey.ps1 | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/StackMonkey.ps1 b/StackMonkey.ps1 index ce6e8dc..6eef5bd 100644 --- a/StackMonkey.ps1 +++ b/StackMonkey.ps1 @@ -8,8 +8,43 @@ [CmdletBinding()] param( [switch]$SilentInstall + [string]$DattoApiUrl, + [string]$DattoApiKey, + [string]$DattoApiSecretKey, + [string]$SiteUID, + [string]$SiteName, + [switch]$PushSiteVars, + [switch]$InstallRMM, + [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" + Install-DattoRMM-Helper ` + -ApiUrl $DattoApiUrl ` + -ApiKey $DattoApiKey ` + -ApiSecretKey $DattoApiSecretKey ` + -SiteUID $SiteUID ` + -SiteName $SiteName ` + -PushSiteVars:$PushSiteVars ` + -InstallRMM:$InstallRMM ` + -SaveCopy:$SaveCopy + return +} + +<# oneliner to silently install DRMM +& ( [ScriptBlock]::Create( (iwr 'https://sm.svstools.com/ScriptMonkey.ps1' -UseBasicParsing).Content )) ` + -DattoApiUrl 'https://your-datto-api-url' ` + -DattoApiKey 'yourKeyHere' ` + -DattoApiSecretKey 'yourSecretHere' ` + -SiteUID 'site-uid-value' ` + -SiteName 'My Client Site' ` + -InstallRMM ` + -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" @@ -17,15 +52,14 @@ if ($SilentInstall) { return } -## To use the silent install of the SVSMSP module -## & ([ScriptBlock]::Create( (iwr 'sm.svstools.ca').Content )) -SilentInstall - #endregion # 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. + + #region Config & Task Definitions # Listening port for HTTP UI @@ -1251,12 +1285,14 @@ function Start-Server { #endregion - # Only launch UI if not in silent mode if (-not $SilentInstall) { - # open browser on whatever port you've set Start-Process "msedge.exe" -ArgumentList "--app=http://localhost:$Port" - # now start your server (this will block until you hit Exit in the UI) Start-Server } #endregion +# open browser on whatever port you've set +#Start-Process "msedge.exe" -ArgumentList "--app=http://localhost:$Port" + +# now start your server (this will block until you hit Exit in the UI) +#Start-Server