diff --git a/Scripts/Helpers/Confirm-ObjectValueEqualityDeep.ps1 b/Scripts/Helpers/Confirm-ObjectValueEqualityDeep.ps1 index a27a0038..b2f4c116 100644 --- a/Scripts/Helpers/Confirm-ObjectValueEqualityDeep.ps1 +++ b/Scripts/Helpers/Confirm-ObjectValueEqualityDeep.ps1 @@ -37,31 +37,9 @@ function Confirm-ObjectValueEqualityDeep { # $Object1 or $Object2 is an array or ArrayList if ($Object1 -isnot [System.Collections.Ilist]) { $Object1 = @($Object1) - # This resolves a unique situation where GraphApi returns a string instead of an array for a metadata value, very unique situation - # By testing the json and count, we can confirm that it is a json string and convert it to an array - # A try catch is included to revert to the value we normally use in the event of failure just in case there is a scenario that has not been accounted for - if ($(Test-Json -Json $Object1) -and $Object1.count -eq 1) { - try { - $Object1 = $Object1 | ConvertFrom-Json -Depth 100 - } - catch { - $Object1 = @($Object1) - } - } } elseif ($Object2 -isnot [System.Collections.Ilist]) { $Object2 = @($Object2) - # This resolves a unique situation where GraphApi returns a string instead of an array for a metadata value, very unique situation - # By testing the json and count, we can confirm that it is a json string and convert it to an array - # A try catch is included to revert to the value we normally use in the event of failure just in case there is a scenario that has not been accounted for - if ($(Test-Json -Json $Object2) -and $Object2.count -eq 1) { - try { - $Object2 = $Object2 | ConvertFrom-Json -Depth 100 - } - catch { - $Object2 = @($Object2) - } - } } if ($Object1.Count -ne $Object2.Count) { return $false