Update StackMonkey.ps1
This commit is contained in:
@@ -282,7 +282,7 @@ function Write-LogHybrid {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────
|
||||||
# 3) MAIN LOGIC (Toolkit vs Datto vs UI)
|
# 3) MAIN LOGIC (Toolkit vs DattoFetch vs DattoInstall vs UI)
|
||||||
# ─────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
@@ -292,29 +292,6 @@ function Write-LogHybrid {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
'Datto' {
|
|
||||||
Write-LogHybrid "Headless DattoRMM deploy (via n8n)" Info Startup
|
|
||||||
try{
|
|
||||||
# ────────────────────────────────────────────
|
|
||||||
# 1) Fetch URL, Key & Secret from n8n webhook
|
|
||||||
# ────────────────────────────────────────────
|
|
||||||
|
|
||||||
# 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 = $creds.ApiUrl
|
|
||||||
$Global:ApiKey = $creds.ApiKey
|
|
||||||
$Global:ApiSecretKey = $creds.ApiSecretKey
|
|
||||||
|
|
||||||
Write-LogHybrid "Fetched Datto API credentials from n8n" Success DattoAuth
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Write-LogHybrid "N8N credential fetch error: $($_.Exception.Message)" Error DattoAuth
|
|
||||||
throw
|
|
||||||
}
|
|
||||||
|
|
||||||
# ───────────────────────────────────────────────────────────
|
# ───────────────────────────────────────────────────────────
|
||||||
# 2) If user only wants the site list, do that and exit
|
# 2) If user only wants the site list, do that and exit
|
||||||
# ───────────────────────────────────────────────────────────
|
# ───────────────────────────────────────────────────────────
|
||||||
@@ -334,8 +311,6 @@ try{
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ────────────────────────────────────────────
|
# ────────────────────────────────────────────
|
||||||
# 3) Invoke the existing Install-DattoRMM cmdlet
|
# 3) Invoke the existing Install-DattoRMM cmdlet
|
||||||
# ────────────────────────────────────────────
|
# ────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user