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 <brian.wuchner@gmail.com>
This commit is contained in:
Brian Wuchner
2022-05-13 16:43:07 -04:00
parent 80622414d6
commit e0e2d1bbdc

View File

@@ -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)