File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Modules/CIPPCore/Public/Webhooks Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -176,10 +176,10 @@ function Test-CIPPAuditLogRules {
176176 }
177177 )
178178 $Response = New-GraphBulkRequest - TenantId $TenantFilter - Requests $Requests
179- $Users = ($Response | Where-Object { $_.id -eq ' users' }).body.value
179+ $Users = ($Response | Where-Object { $_.id -eq ' users' }).body.value ?? @ ()
180180 $Groups = ($Response | Where-Object { $_.id -eq ' groups' }).body.value ?? @ ()
181181 $Devices = ($Response | Where-Object { $_.id -eq ' devices' }).body.value ?? @ ()
182- $ServicePrincipals = ($Response | Where-Object { $_.id -eq ' servicePrincipals' }).body.value
182+ $ServicePrincipals = ($Response | Where-Object { $_.id -eq ' servicePrincipals' }).body.value ?? @ ()
183183 # Cache the lookups for 1 day
184184 $Entities = @ (
185185 @ {
@@ -208,10 +208,10 @@ function Test-CIPPAuditLogRules {
208208 Write-Information " Cached directory lookups for tenant $TenantFilter "
209209 } else {
210210 # Use cached lookups
211- $Users = ($Lookups | Where-Object { $_.RowKey -eq ' users' }).Data | ConvertFrom-Json
211+ $Users = (( $Lookups | Where-Object { $_.RowKey -eq ' users' }).Data | ConvertFrom-Json - ErrorAction SilentlyContinue) ?? @ ()
212212 $Groups = (($Lookups | Where-Object { $_.RowKey -eq ' groups' }).Data | ConvertFrom-Json - ErrorAction SilentlyContinue) ?? @ ()
213213 $Devices = (($Lookups | Where-Object { $_.RowKey -eq ' devices' }).Data | ConvertFrom-Json - ErrorAction SilentlyContinue) ?? @ ()
214- $ServicePrincipals = ($Lookups | Where-Object { $_.RowKey -eq ' servicePrincipals' }).Data | ConvertFrom-Json
214+ $ServicePrincipals = (( $Lookups | Where-Object { $_.RowKey -eq ' servicePrincipals' }).Data | ConvertFrom-Json - ErrorAction SilentlyContinue) ?? @ ()
215215 Write-Information " Using cached directory lookups for tenant $TenantFilter "
216216 }
217217
You can’t perform that action at this time.
0 commit comments