Update StackMonkey.ps1
This commit is contained in:
@@ -290,7 +290,7 @@ function Handle-FetchSites {
|
||||
}
|
||||
|
||||
# 3) Exchange for a bearer token
|
||||
Write-LogHybrid "Requesting OAuth token…" "Info" "FetchSites"
|
||||
Write-LogHybrid "Requesting OAuth token" "Info" "FetchSites"
|
||||
try {
|
||||
$securePublic = ConvertTo-SecureString 'public' -AsPlainText -Force
|
||||
$creds = New-Object System.Management.Automation.PSCredential('public-client',$securePublic)
|
||||
@@ -309,7 +309,7 @@ function Handle-FetchSites {
|
||||
}
|
||||
|
||||
# 4) Pull the site list
|
||||
Write-LogHybrid "Fetching Datto RMM site list…" "Info" "FetchSites"
|
||||
Write-LogHybrid "Fetching Datto RMM site list" "Info" "FetchSites"
|
||||
try {
|
||||
$hdr = @{ Authorization = "Bearer $token" }
|
||||
$sitesResp = Invoke-RestMethod -Uri "$ApiUrl/api/v2/account/sites" `
|
||||
|
||||
Reference in New Issue
Block a user