We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 312b254 commit 409a8edCopy full SHA for 409a8ed
1 file changed
Modules/CIPPCore/Public/Compare-CIPPIntuneObject.ps1
@@ -285,8 +285,15 @@ function Compare-CIPPIntuneObject {
285
# Both empty (null, "", []) - no difference
286
continue
287
}
288
- if ($val1 -or $val2) {
+ if ($null -ne $val1 -and $null -ne $val2) {
289
Compare-ObjectsRecursively -Object1 $val1 -Object2 $val2 -PropertyPath $newPath -Depth ($Depth + 1) -MaxDepth $MaxDepth
290
+ } elseif (-not $val1IsEmpty -or -not $val2IsEmpty) {
291
+ # One side is null/empty, the other is not - report as difference
292
+ $result.Add([PSCustomObject]@{
293
+ Property = $newPath
294
+ ExpectedValue = if ($null -eq $val1) { '' } else { $val1 }
295
+ ReceivedValue = if ($null -eq $val2) { '' } else { $val2 }
296
+ })
297
298
} catch {
299
throw
0 commit comments