Skip to content

Commit 66ff8f5

Browse files
committed
ca template deployment logging for packages
1 parent ee92936 commit 66ff8f5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardConditionalAccessTemplate.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ function Invoke-CIPPStandardConditionalAccessTemplate {
105105
$Filter = "PartitionKey eq 'CATemplate' and RowKey eq '$($Settings.TemplateList.value)'"
106106
$Policy = (Get-CippAzDataTableEntity @Table -Filter $Filter).JSON | ConvertFrom-Json -Depth 10
107107

108+
if ($null -eq $Policy) {
109+
Write-LogMessage -API 'Standards' -tenant $Tenant -message "Conditional Access template '$($Settings.TemplateList.label)' ($($Settings.TemplateList.value)) could not be loaded from the template store - skipping." -Sev 'Error'
110+
Set-CIPPStandardsCompareField -FieldName "standards.ConditionalAccessTemplate.$($Settings.TemplateList.value)" -FieldValue "Template '$($Settings.TemplateList.label)' could not be loaded from the template store." -Tenant $Tenant
111+
return
112+
}
113+
108114
# Override the template's state with the Drift Standard's state if specified
109115
# This ensures drift detection compares against the desired state, not the original template state
110116
if ($Settings.state -and $Settings.state -ne 'donotchange') {

0 commit comments

Comments
 (0)