Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADUser advanced query filter support #4430

Merged
merged 7 commits into from
Apr 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1018,19 +1018,25 @@ function Export-TargetResource
$allConditionsMatched = $true

# Check each condition in the filter against the support list
foreach ($condition in $Filter.Split(' '))
{
if ($condition -match '(\w+)/(\w+):(\w+)')
{
$attribute, $operation, $value = $matches[1], $matches[2], $matches[3]
if (-not $queryTypes.ContainsKey($operation) -or -not $queryTypes[$operation].Contains($attribute))
{
$allConditionsMatched = $false
break
# Assuming the provided PowerShell script is part of a larger context and the variable $Filter is defined elsewhere

# Check if $Filter is not null
if ($Filter) {
# Check each condition in the filter against the support list
foreach ($condition in $Filter.Split(' ')) {
if ($condition -match '(\w+)/(\w+):(\w+)') {
$attribute, $operation, $value = $matches[1], $matches[2], $matches[3]
if (-not $queryTypes.ContainsKey($operation) -or -not $queryTypes[$operation].Contains($attribute)) {
$allConditionsMatched = $false
break
}
}
}
} else {
Write-Host "$Filter is null or empty."
NikCharlebois marked this conversation as resolved.
Show resolved Hide resolved
}


# If all conditions match the support, add parameters to $ExportParameters
if ($allConditionsMatched -or $Filter -like '*endsWith*')
{
Expand Down
Loading