Merge pull request #598 from bwuch/master
Updating module to resolve duplicate object bug
This commit is contained in:
@@ -17,7 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause
|
||||
RootModule = 'VMware.Skyline.InsightsApi.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.0.0'
|
||||
ModuleVersion = '1.0.1'
|
||||
|
||||
# Supported PSEditions
|
||||
# CompatiblePSEditions = @()
|
||||
|
||||
@@ -237,10 +237,9 @@ Function Get-SkylineFinding {
|
||||
|
||||
# Try to get results the first time
|
||||
$results = @()
|
||||
$thisQueryBody = $queryBody -Replace 'filter: {}', "filter: { $filterString }"
|
||||
$thisIteration = 0
|
||||
do {
|
||||
$thisQueryBody = $thisQueryBody -Replace 'start: 0', "start: $thisIteration"
|
||||
$thisQueryBody = $queryBody -Replace 'filter: {}', "filter: { $filterString }" -Replace 'start: 0', "start: $thisIteration"
|
||||
Write-Debug $thisQueryBody
|
||||
$thisResult = Invoke-SkylineInsightsApi -queryBody (@{'query' = $thisQueryBody} | ConvertTo-Json -Compress)
|
||||
$totalRecords = $thisResult.data.activeFindings.totalRecords
|
||||
@@ -325,13 +324,11 @@ Function Get-SkylineAffectedObject {
|
||||
}
|
||||
|
||||
process {
|
||||
$thisQueryBody = $queryBody -Replace 'findingId: "",', "findingId: `"$findingId`","
|
||||
foreach ( $thisProduct in $products ) {
|
||||
$thisIteration = 0
|
||||
$results = @() # reset results variable between products
|
||||
do {
|
||||
$thisQueryBody = $thisQueryBody -Replace 'product: "",', "product: `"$thisProduct`","
|
||||
$thisQueryBody = $thisQueryBody -Replace 'start: 0', "start: $thisIteration"
|
||||
$thisQueryBody = $queryBody -Replace 'product: "",', "product: `"$thisProduct`"," -Replace 'start: 0', "start: $thisIteration" -Replace 'findingId: "",', "findingId: `"$findingId`","
|
||||
Write-Debug $thisQueryBody
|
||||
$thisResult = Invoke-SkylineInsightsApi -queryBody (@{'query' = $thisQueryBody} | ConvertTo-Json -Compress)
|
||||
$totalRecords = $thisResult.data.activeFindings.Findings.totalAffectedObjectsCount
|
||||
|
||||
Reference in New Issue
Block a user