From 0ed55caa8f18e82427573d9bcc096ef2c182f038 Mon Sep 17 00:00:00 2001 From: GajendraKS Date: Mon, 17 May 2021 08:24:52 +0530 Subject: [PATCH] Create ordered dict from New-Object to handle case sensitvity --- PSYaml/Private/ConvertFrom-YAMLDocument.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSYaml/Private/ConvertFrom-YAMLDocument.ps1 b/PSYaml/Private/ConvertFrom-YAMLDocument.ps1 index c52fea4..638822e 100644 --- a/PSYaml/Private/ConvertFrom-YAMLDocument.ps1 +++ b/PSYaml/Private/ConvertFrom-YAMLDocument.ps1 @@ -56,8 +56,8 @@ function ConvertFrom-YAMLDocument } elseif ($TheTypeOfNode -eq 'YamlMappingNode') #ah mapping nodes { - $TheObject = [ordered]@{ } - $theNode | ForEach-Object{ + $TheObject = New-Object System.Collections.Specialized.OrderedDictionary + $theNode | ForEach-Object{ $TheObject.($_.Key.Value) = ConvertFrom-YAMLDocument $_.Value } }