Update StackMonkey.ps1
This commit is contained in:
@@ -170,10 +170,15 @@ switch ($PSCmdlet.ParameterSetName) {
|
||||
if (-not $creds) {
|
||||
throw "Failed to retrieve Datto API credentials from n8n"
|
||||
}
|
||||
# overwrite the parameters with what we just fetched
|
||||
$DattoApiUrl = $creds.ApiUrl
|
||||
$DattoApiKey = $creds.ApiKey
|
||||
$DattoApiSecretKey = $creds.ApiSecretKey
|
||||
|
||||
# 1) Fetch creds
|
||||
$creds = Get-DattoApiCredentials -Password $N8nPassword
|
||||
if (-not $creds) { throw "Could not fetch creds" }
|
||||
|
||||
# 2) Store in globals for everyone else
|
||||
$Global:ApiUrl = $resp.ApiUrl
|
||||
$Global:ApiKey = $resp.ApiKey
|
||||
$Global:ApiSecretKey = $resp.ApiSecretKey
|
||||
|
||||
Write-LogHelper "Fetched Datto API credentials from n8n" Success DattoAuth
|
||||
}
|
||||
@@ -186,9 +191,9 @@ switch ($PSCmdlet.ParameterSetName) {
|
||||
# 2) Invoke the existing Install-DattoRMM cmdlet
|
||||
# ────────────────────────────────────────────
|
||||
Install-DattoRMM `
|
||||
-ApiUrl $DattoApiUrl `
|
||||
-ApiKey $DattoApiKey `
|
||||
-ApiSecretKey $DattoApiSecretKey `
|
||||
-ApiUrl $Global:ApiUrl `
|
||||
-ApiKey $Global:ApiKey `
|
||||
-ApiSecretKey $Global:ApiSecretKey `
|
||||
-SiteUID $SiteUID `
|
||||
-SiteName $SiteName `
|
||||
-PushSiteVars:$PushSiteVars `
|
||||
|
||||
Reference in New Issue
Block a user