From e0e2d1bbdc5836dd63e5a8aaa7a418a1e30ec2f2 Mon Sep 17 00:00:00 2001 From: Brian Wuchner Date: Fri, 13 May 2022 16:43:07 -0400 Subject: [PATCH] Update VMware.Skyline.InsightsApi.psm1 I accidentally committed a version with a query problem in Get-SkylineAffectedObject. This version does not contain that search problem. Signed-off-by: Brian Wuchner --- .../VMware.Skyline.InsightsApi.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/VMware.Skyline.InsightsApi/VMware.Skyline.InsightsApi.psm1 b/Modules/VMware.Skyline.InsightsApi/VMware.Skyline.InsightsApi.psm1 index 217ffb4..8349088 100644 --- a/Modules/VMware.Skyline.InsightsApi/VMware.Skyline.InsightsApi.psm1 +++ b/Modules/VMware.Skyline.InsightsApi/VMware.Skyline.InsightsApi.psm1 @@ -297,7 +297,7 @@ Function Get-SkylineAffectedObject { { activeFindings( filter: { - findingId: "$findingId", + findingId: "", product: "", }) { findings { @@ -322,15 +322,15 @@ Function Get-SkylineAffectedObject { "@ # Try to get results the first time - $results = @() } process { + $thisQueryBody = $queryBody -Replace 'findingId: "",', "findingId: `"$findingId`"," foreach ( $thisProduct in $products ) { $thisIteration = 0 $results = @() # reset results variable between products do { - $thisQueryBody = $queryBody -Replace 'product: "",', "product: `"$thisProduct`"," + $thisQueryBody = $thisQueryBody -Replace 'product: "",', "product: `"$thisProduct`"," $thisQueryBody = $thisQueryBody -Replace 'start: 0', "start: $thisIteration" Write-Debug $thisQueryBody $thisResult = Invoke-SkylineInsightsApi -queryBody (@{'query' = $thisQueryBody} | ConvertTo-Json -Compress)