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 } }