Skip to content

Commit

Permalink
Preserve key order
Browse files Browse the repository at this point in the history
  • Loading branch information
valleyofdoom committed Jun 28, 2024
1 parent 2e4c4f2 commit 52981c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/apply-registry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ function main() {

# get all option names in the sorted hashmap
foreach ($option in $config.options.PSObject.Properties.Name) {
$options.Add($option, @{})
$options.Add($option, (New-Object System.Collections.Specialized.OrderedDictionary))
}

# populate the hashmap with all the option paths and keys
Expand All @@ -688,7 +688,7 @@ function main() {
foreach ($applyIfOption in $key["apply_if"]) {
# initialize path if it doesn't
if (-not ($options[$applyIfOption].Contains($path))) {
$options[$applyIfOption].Add($path, @{})
$options[$applyIfOption].Add($path, (New-Object System.Collections.Specialized.OrderedDictionary))
}

$options[$applyIfOption][$path].Add($keyName, $key)
Expand Down

0 comments on commit 52981c9

Please sign in to comment.