From e242865ef4690d650839bf2880fa850430325270 Mon Sep 17 00:00:00 2001 From: Mikael Karlsson <43226266+Micke-K@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:08:24 +1100 Subject: [PATCH] 3.10.1.16 Issue 378 - Fixed issue when "Sort Json Properties" is enabled. Arrays were broken e.g. empty array ended up as null and single item ended up as string. This broke export/import of Conditional Access policies. --- Extensions/MSGraph.psm1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Extensions/MSGraph.psm1 b/Extensions/MSGraph.psm1 index 69f7789..b8348a6 100644 --- a/Extensions/MSGraph.psm1 +++ b/Extensions/MSGraph.psm1 @@ -4872,6 +4872,15 @@ function Invoke-SortJsonGraphObject { else { $result[$p] = $null } + + if($InputObject.$p -is [Array] -and $result[$p] -isnot [Array]) { + if($result[$p] -eq $null) { + $result[$p] = @() + } + else { + $result[$p] = @($result[$p]) + } + } } return [pscustomobject]$result