Preventing Spark! from hanging our prescious Get-PC

This commit is contained in:
Zachary Gorman 2024-09-05 13:16:01 -07:00
parent 57384fff05
commit f950cd11a7
3 changed files with 6 additions and 2 deletions

View file

@ -12,7 +12,7 @@
RootModule = 'Get-PC.psm1'
# Version number of this module.
ModuleVersion = '0.4.5'
ModuleVersion = '0.4.6'
# Supported PSEditions
# CompatiblePSEditions = @()

View file

@ -302,9 +302,10 @@ function Get-PCBatchInvoke {
Default {$chassisType = "Unknown Model/Chassis"}
}
Write-Progress -Activity "Retrieving data from online computers" -Status "$Env:COMPUTERNAME | Querying Spark!... Timeout 100s" -PercentComplete 90
$uri = "${using:Tenant}/api/odata/businessobject/cis`?`$filter=Name eq '$ENV:COMPUTERNAME'&`$top=1&`$skip=0"
try {
$Query = Invoke-RestMethod -Method GET -uri $uri -headers ${using:Headers}
$Query = Invoke-RestMethod -Method GET -uri $uri -headers ${using:Headers} -TimeoutSec 100
} catch {
Write-Host $_.Exception.Message
}

View file

@ -1,3 +1,6 @@
Patch: 2024-09-05
-Fix Spark! hangs sometimes, added timeout in BatchInvokes
Patch: 2024-09-04
-Add Logging for GetPCWrapped
-Fix Ambiguous CMDB results now report error message