Skip to content

Commit 3204da3

Browse files
authored
Update Get-CIPPStandards.ps1 to fix Custom Quarantine Policy not reporting correctly. (KelvinTegelaar#2105)
Updated "Get-CIPPStadnards.ps1" to resolve Custom Quarantine Policy not reporting correctly and always showing as non compliant due to Expected and Current not returning information. Fix now reports Expected and Current resulting in Compliant if complete and non-compliants if missing.
2 parents d2e88c5 + 612f2f8 commit 3204da3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ function Get-CIPPStandards {
319319
$Actions = $CurrentStandard.action.value
320320
if ($Actions -contains 'Remediate' -or $Actions -contains 'warn' -or $Actions -contains 'Report') {
321321
# Key by StandardName + TemplateList.value (if present)
322-
$TemplateKey = if ($CurrentStandard.TemplateList.value) { $CurrentStandard.TemplateList.value } else { '' }
322+
$TemplateKey = if ($CurrentStandard.TemplateList.value) { $CurrentStandard.TemplateList.value } elseif ($CurrentStandard.displayName.value) { $CurrentStandard.displayName.value } elseif ($CurrentStandard.displayName) { $CurrentStandard.displayName } else { [guid]::NewGuid().ToString() }
323323
$Key = "$StandardName|$TemplateKey"
324324

325325
$ComputedStandards[$Key] = $CurrentStandard
@@ -388,7 +388,7 @@ function Get-CIPPStandards {
388388

389389
$Actions = $CurrentStandard.action.value
390390
if ($Actions -contains 'Remediate' -or $Actions -contains 'warn' -or $Actions -contains 'Report') {
391-
$TemplateKey = if ($CurrentStandard.TemplateList.value) { $CurrentStandard.TemplateList.value } else { '' }
391+
$TemplateKey = if ($CurrentStandard.TemplateList.value) { $CurrentStandard.TemplateList.value } elseif ($CurrentStandard.displayName.value) { $CurrentStandard.displayName.value } elseif ($CurrentStandard.displayName) { $CurrentStandard.displayName } else { [guid]::NewGuid().ToString() }
392392
$Key = "$StandardName|$TemplateKey"
393393

394394
if ($ComputedStandards.ContainsKey($Key)) {
@@ -468,7 +468,7 @@ function Get-CIPPStandards {
468468

469469
$Actions = $CurrentStandard.action.value
470470
if ($Actions -contains 'Remediate' -or $Actions -contains 'warn' -or $Actions -contains 'Report') {
471-
$TemplateKey = if ($CurrentStandard.TemplateList.value) { $CurrentStandard.TemplateList.value } else { '' }
471+
$TemplateKey = if ($CurrentStandard.TemplateList.value) { $CurrentStandard.TemplateList.value } elseif ($CurrentStandard.displayName.value) { $CurrentStandard.displayName.value } elseif ($CurrentStandard.displayName) { $CurrentStandard.displayName } else { [guid]::NewGuid().ToString() }
472472
$Key = "$StandardName|$TemplateKey"
473473

474474
if ($ComputedStandards.ContainsKey($Key)) {

0 commit comments

Comments
 (0)