Update StackMonkey.ps1
This commit is contained in:
130
StackMonkey.ps1
130
StackMonkey.ps1
@@ -39,83 +39,93 @@
|
||||
|
||||
.PARAMETER SaveCopy
|
||||
Switch to download the RMM installer executable during the headless DattoRMM install.
|
||||
|
||||
.EXAMPLE
|
||||
# One-liner to silently install DattoRMM via ScriptMonkey:
|
||||
& ([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
|
||||
|
||||
.EXAMPLE
|
||||
& ([ScriptBlock]::Create( (iwr 'sm.svstools.ca').Content )) -SilentInstall
|
||||
|
||||
#>
|
||||
|
||||
function Invoke-ScriptMonkey {
|
||||
#region ScriptMonkey run silently Entrypoint
|
||||
[CmdletBinding(DefaultParameterSetName='UI')]
|
||||
param(
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# Toolkit-only mode
|
||||
[Parameter(Mandatory,ParameterSetName='Toolkit')]
|
||||
[switch]$SilentInstall,
|
||||
|
||||
#region ScriptMonkey run silently Entrypoint
|
||||
[CmdletBinding(DefaultParameterSetName='UI')]
|
||||
param(
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# Toolkit-only mode
|
||||
[Parameter(Mandatory,ParameterSetName='Toolkit')]
|
||||
[switch]$SilentInstall,
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# Datto headless mode
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $DattoApiUrl,
|
||||
|
||||
# ─────────────────────────────────────────────────────────
|
||||
# Datto headless mode
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $DattoApiUrl,
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $DattoApiKey,
|
||||
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $DattoApiKey,
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $DattoApiSecretKey,
|
||||
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $DattoApiSecretKey,
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $SiteUID,
|
||||
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $SiteUID,
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $SiteName,
|
||||
|
||||
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||
#[ValidateNotNullOrEmpty()]
|
||||
[string] $SiteName,
|
||||
[Parameter(ParameterSetName='Datto')]
|
||||
[switch] $PushSiteVars,
|
||||
|
||||
[Parameter(ParameterSetName='Datto')]
|
||||
[switch] $PushSiteVars,
|
||||
[Parameter(ParameterSetName='Datto')]
|
||||
[switch] $InstallRMM,
|
||||
|
||||
[Parameter(ParameterSetName='Datto')]
|
||||
[switch] $InstallRMM,
|
||||
[Parameter(ParameterSetName='Datto')]
|
||||
[switch] $SaveCopy
|
||||
)
|
||||
|
||||
[Parameter(ParameterSetName='Datto')]
|
||||
[switch] $SaveCopy
|
||||
)
|
||||
|
||||
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 `
|
||||
-ApiSecretKey $DattoApiSecretKey `
|
||||
-SiteUID $SiteUID `
|
||||
-SiteName $SiteName `
|
||||
-PushSiteVars:$PushSiteVars `
|
||||
-InstallRMM:$InstallRMM `
|
||||
-SaveCopy:$SaveCopy
|
||||
return
|
||||
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 `
|
||||
-ApiSecretKey $DattoApiSecretKey `
|
||||
-SiteUID $SiteUID `
|
||||
-SiteName $SiteName `
|
||||
-PushSiteVars:$PushSiteVars `
|
||||
-InstallRMM:$InstallRMM `
|
||||
-SaveCopy:$SaveCopy
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# If we got here, it's the UI set—launch browser + listener:
|
||||
# ——— UI fallback starts here ———
|
||||
Write-LogHelper "Launching UI" Info Startup
|
||||
|
||||
|
||||
<# 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
|
||||
#>
|
||||
|
||||
# STACK = Scripted Tooling for Automated Client Kickoff
|
||||
# MONKEY = Module-based Onboarding & Next-step Kickoff Engine Yoke
|
||||
|
||||
Reference in New Issue
Block a user