Skip to content

Commit 9cb1ebf

Browse files
committed
Updated debug logging for Test Query Param 🪵
1 parent 1737c89 commit 9cb1ebf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Rubrik/Private/Test-QueryParam.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,16 @@
7878
foreach ($param in $parameters) {
7979
# If the parameter name matches the query option name, build a query string
8080
if ($param.Name -eq $query) {
81-
Write-Debug ('Building Query with "{0}: {1}"' -f $resources.Query[$param.Name], (Get-Variable -Name $param.Name).Value)
81+
if ((Get-Variable -Name $param.Name).Value) {
82+
Write-Debug ('Building Query with "{0}: {1}"' -f $resources.Query[$param.Name], (Get-Variable -Name $param.Name).Value)
83+
}
8284
$querystring += Test-QueryObject -object (Get-Variable -Name $param.Name).Value -location $resources.Query[$param.Name] -params $querystring
8385
}
8486
# If the parameter alias matches the query option name, build a query string
8587
elseif ($param.Aliases -eq $query) {
86-
Write-Debug ('Building Query with "{0}: {1}"' -f (-join $resources.Query[$param.Aliases]), (Get-Variable -Name $param.Name).Value)
88+
if ((Get-Variable -Name $param.Name).Value) {
89+
Write-Debug ('Building Query with "{0}: {1}"' -f (-join $resources.Query[$param.Aliases]), (Get-Variable -Name $param.Name).Value)
90+
}
8791
$querystring += Test-QueryObject -object (Get-Variable -Name $param.Name).Value -location $resources.Query[$param.Aliases] -params $querystring
8892
}
8993
}

0 commit comments

Comments
 (0)