Skip to content

Commit

Permalink
Search-TssDirectoryServiceDomain - fixed inactive results when param …
Browse files Browse the repository at this point in the history
…not provided
  • Loading branch information
wsmelton committed Sep 10, 2021
1 parent fb4edce commit e2632cc
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@ function Search-TssDirectoryServiceDomain {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
$restResponse = $null
$uri = $TssSession.ApiUrl, 'directory-services', 'domains' -join '/'
$uri = $uri, "sortBy[0].direction=asc&sortBy[0].name=$SortBy&take=$($TssSession.Take)" -join '?'
$uri = $uri, "sortBy[0].direction=asc&sortBy[0].name=$SortBy&take=$($TssSession.Take)&filter.includeInactive=$([boolean]$IncludeInactive)" -join '?'

$filters = @()
if ($tssParams.ContainsKey('DomainName')) {
$filters += "filter.DomainName=$DomainName"
}
if ($tssParams.ContainsKey('IncludeInactive')) {
$filters += "filter.includeInactive=$([boolean]$IncludeInactive)"
}
if ($filters) {
$uriFilter = $filters -join '&'
Write-Verbose "Filters: $uriFilter"
Expand Down

0 comments on commit e2632cc

Please sign in to comment.