Update StackMonkey.ps1
This commit is contained in:
@@ -43,23 +43,53 @@
|
||||
|
||||
|
||||
#region ScriptMonkey run silently Entrypoint
|
||||
|
||||
[CmdletBinding()]
|
||||
[CmdletBinding(DefaultParameterSetName='UI')]
|
||||
param(
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# Toolkit-only mode
|
||||
[Parameter(Mandatory,ParameterSetName='Toolkit')]
|
||||
[switch]$SilentInstall,
|
||||
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# 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 `
|
||||
@@ -72,6 +102,8 @@ if ($DattoApiUrl -and $DattoApiKey -and $DattoApiSecretKey -and $SiteUID -and $S
|
||||
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 )) `
|
||||
-DattoApiUrl 'https://your-datto-api-url' `
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user