I have the following sample script
$aDomains = @{}
$aDomains['a-test.nl'] = @{}
$aDomains['b-test.nl'] = @{}
$aDomains['c-test.nl'] = @{}
$aDomains['d-test.nl'] = @{}
$aDomains['e-test.nl'] = @{}
$aDomains
It seems very straight forward, but if I run this script, the output is very unexpected:
$aDomains
Name Value
---- -----
e-test.nl {}
d-test.nl {}
b-test.nl {}
a-test.nl {}
c-test.nl {}
How can I get the output to match the order of items being added? I do need to use the @{} on all instances due to what happens next in the script.
Also, adding this in the script has no effect at all:
$aDomains = $aDomains | Sort-Object