Update VMware.Skyline.InsightsApi.psm1

Moving the ParameterSetName checks to the process block instead of the begin block.

Signed-off-by: Brian Wuchner <brian.wuchner@gmail.com>
This commit is contained in:
Brian Wuchner
2022-02-23 15:18:04 -05:00
parent bc6d2e8a5f
commit 3cd0fe0ca5

View File

@@ -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`","