File tree Expand file tree Collapse file tree
Modules/CIPPCore/Public/Standards Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,16 +48,22 @@ function Invoke-CIPPStandardSpoofWarn {
4848
4949 # Test if all entries in the AllowListAdd variable are in the AllowList
5050 $AllowListCorrect = $true
51- $AllowListAddEntries = foreach ($entry in $AllowListAdd ) {
52- if ($CurrentInfo.AllowList -notcontains $entry ) {
53- $AllowListCorrect = $false
54- Write-Host " AllowList entry $entry not found in current AllowList"
55- $entry
56- } else {
57- Write-Host " AllowList entry $entry found in current AllowList."
51+
52+ if ($AllowListAdd -eq $null -or $AllowListAdd.Count -eq 0 ) {
53+ Write-Host ' No AllowList entries provided, skipping AllowList check.'
54+ $AllowListAdd = @ {' @odata.type' = ' #Exchange.GenericHashTable' ; Add = @ () }
55+ } else {
56+ $AllowListAddEntries = foreach ($entry in $AllowListAdd ) {
57+ if ($CurrentInfo.AllowList -notcontains $entry ) {
58+ $AllowListCorrect = $false
59+ Write-Host " AllowList entry $entry not found in current AllowList"
60+ $entry
61+ } else {
62+ Write-Host " AllowList entry $entry found in current AllowList."
63+ }
5864 }
65+ $AllowListAdd = @ {' @odata.type' = ' #Exchange.GenericHashTable' ; Add = $AllowListAddEntries }
5966 }
60- $AllowListAdd = @ {' @odata.type' = ' #Exchange.GenericHashTable' ; Add = $AllowListAddEntries }
6167
6268 # Debug output
6369 # Write-Host ($CurrentInfo | ConvertTo-Json -Depth 10)
You can’t perform that action at this time.
0 commit comments