Update StackMonkey.ps1
This commit is contained in:
@@ -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,
|
||||||
[string]$DattoApiUrl,
|
|
||||||
[string]$DattoApiKey,
|
# ─────────────────────────────────────────────────────────
|
||||||
[string]$DattoApiSecretKey,
|
# Datto headless mode
|
||||||
[string]$SiteUID,
|
[Parameter(Mandatory,ParameterSetName='Datto')]
|
||||||
[string]$SiteName,
|
[ValidateNotNullOrEmpty()]
|
||||||
[switch]$PushSiteVars,
|
[string] $DattoApiUrl,
|
||||||
[switch]$InstallRMM,
|
|
||||||
[switch]$SaveCopy
|
[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
|
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 `
|
||||||
@@ -70,7 +100,9 @@ if ($DattoApiUrl -and $DattoApiKey -and $DattoApiSecretKey -and $SiteUID -and $S
|
|||||||
-InstallRMM:$InstallRMM `
|
-InstallRMM:$InstallRMM `
|
||||||
-SaveCopy:$SaveCopy
|
-SaveCopy:$SaveCopy
|
||||||
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 )) `
|
||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user