Skip to content

Commit

Permalink
createObject edge case and metadata ordering. (#890)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Watherston <[email protected]>
  • Loading branch information
anwather and Anthony Watherston authored Feb 24, 2025
1 parent 17efcec commit 537a0ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Scripts/Helpers/Confirm-ParametersUsageMatches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ function Confirm-ParametersUsageMatches {
$definedParameter = $definedParameters.$definedParameterName
}

$existingParameterValue = $existingParameter
if ($null -ne $existingParameterValue.value) {
if ($existingParameter -is [System.Collections.Hashtable]) {
$existingParameterValue = $existingParameter.value
}
else {
$existingParameterValue = $existingParameter
}

$definedParameterValue = $definedParameter
if ($null -ne $definedParameterValue.value) {
if (($null -ne $definedParameterValue.value) -and (-not($uniqueKeys -contains "AzurePatchRingmaintenanceConfigurationResourceId"))) {
$definedParameterValue = $definedParameter.value
}

if (!(Confirm-ObjectValueEqualityDeep $existingParameterValue $definedParameterValue)) {
return $false
}
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Helpers/ConvertTo-HashTable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function ConvertTo-HashTable {
$InputObject = $null
)

[hashtable] $hashTable = @{}
[hashtable] $hashTable = [ordered]@{}
if ($null -ne $InputObject) {
if ($InputObject -is [System.Collections.IDictionary]) {
if ($InputObject -is [hashtable]) {
Expand Down

0 comments on commit 537a0ed

Please sign in to comment.