Skip to content

Commit e8d61cc

Browse files
Merge pull request KelvinTegelaar#1451 from Ren-Roros-Digital/GroupExclude
feat: Allow exclude when Group is included
2 parents 6242c7f + 0ca55a2 commit e8d61cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/Standards/Get-CIPPStandards.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function Get-CIPPStandards {
141141
$excludedTenantValues = $template.excludedTenants | ForEach-Object {
142142
$FilterValue = $_.value
143143
if ($_.type -eq 'Group') {
144-
($TenantGroups | Where-Object {
144+
($TenantGroups | Where-Object {
145145
$_.Id -eq $FilterValue
146146
}).Members.defaultDomainName
147147
} else {
@@ -158,7 +158,7 @@ function Get-CIPPStandards {
158158
if ($tenantFilterValues -contains 'AllTenants' -and -not ($excludedTenantValues -contains $TenantName)) {
159159
$AllTenantsApplicable = $true
160160
}
161-
if ($tenantFilterValues -contains $TenantName) {
161+
if ($tenantFilterValues -contains $TenantName -and -not ($excludedTenantValues -contains $TenantName)) {
162162
$TenantSpecificApplicable = $true
163163
}
164164

0 commit comments

Comments
 (0)