Update StackMonkey.ps1
This commit is contained in:
@@ -138,7 +138,7 @@ switch ($PSCmdlet.ParameterSetName) {
|
|||||||
|
|
||||||
# 1) Fetch creds
|
# 1) Fetch creds
|
||||||
$resp = Get-DattoApiCredentials -Password $N8nPassword
|
$resp = Get-DattoApiCredentials -Password $N8nPassword
|
||||||
if (-not $creds) { throw "Could not fetch creds" }
|
if (-not $resp) { throw "Could not fetch creds" }
|
||||||
|
|
||||||
# 2) Store in globals for everyone else
|
# 2) Store in globals for everyone else
|
||||||
$Global:ApiUrl = $resp.ApiUrl
|
$Global:ApiUrl = $resp.ApiUrl
|
||||||
@@ -445,16 +445,16 @@ function Handle-FetchSites {
|
|||||||
# 2) Fetch your Datto API creds from the webhook
|
# 2) Fetch your Datto API creds from the webhook
|
||||||
Write-LogHybrid "Calling webhook for Datto credentials…" "Info" "FetchSites"
|
Write-LogHybrid "Calling webhook for Datto credentials…" "Info" "FetchSites"
|
||||||
<#
|
<#
|
||||||
$creds = Get-DattoApiCredentials -Password $N8nPassword
|
$resp = Get-DattoApiCredentials -Password $N8nPassword
|
||||||
if (-not $creds) {
|
if (-not $resp) {
|
||||||
Write-LogHelper "Failed to retrieve Datto API credentials from n8n" Error DattoAuth
|
Write-LogHelper "Failed to retrieve Datto API credentials from n8n" Error DattoAuth
|
||||||
throw
|
throw
|
||||||
}
|
}
|
||||||
|
|
||||||
# now exactly the same values are populated:
|
# now exactly the same values are populated:
|
||||||
$Global:ApiUrl = $creds.ApiUrl
|
$Global:ApiUrl = $resp.ApiUrl
|
||||||
$Global:ApiKey = $creds.ApiKey
|
$Global:ApiKey = $resp.ApiKey
|
||||||
$Global:ApiSecretKey = $creds.ApiSecretKey
|
$Global:ApiSecretKey = $resp.ApiSecretKey
|
||||||
Write-LogHelper "Fetched Datto API credentials from n8n" Success DattoAuth
|
Write-LogHelper "Fetched Datto API credentials from n8n" Success DattoAuth
|
||||||
#> #could replace the following 15 lines
|
#> #could replace the following 15 lines
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user