From 3cd0fe0ca590329ce4c9b304ea9e8e4201bd40f7 Mon Sep 17 00:00:00 2001 From: Brian Wuchner Date: Wed, 23 Feb 2022 15:18:04 -0500 Subject: [PATCH] Update VMware.Skyline.InsightsApi.psm1 Moving the ParameterSetName checks to the process block instead of the begin block. 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 012004e..a210389 100644 --- a/Modules/VMware.Skyline.InsightsApi/VMware.Skyline.InsightsApi.psm1 +++ b/Modules/VMware.Skyline.InsightsApi/VMware.Skyline.InsightsApi.psm1 @@ -281,7 +281,9 @@ Function Get-SkylineAffectedObject { # Try to get results the first time $results = @() + } + process { if ($PSCmdlet.ParameterSetName -eq 'ByName') { $procProduct = $product.Split($separator).Trim() | Where-Object {$_ -ne '' } # depending on separator we could end up with null rows on split, we'll omit those with where object @@ -291,9 +293,7 @@ Function Get-SkylineAffectedObject { if ($PSCmdlet.ParameterSetName -eq 'ByObject') { $procProduct = $products.products } - } - - process { + foreach ( $thisProduct in $procProduct ) { $thisQueryBody = $queryBody -Replace 'findingId: "",', "findingId: `"$findingId`"," $thisQueryBody = $thisQueryBody -Replace 'product: "",', "product: `"$thisProduct`","