# Sort Hashtable by Key
$xx = [ordered] @{
"b" = 2
"a" = 1
}
$yy = ($xx. getenumerator() | Sort-Object -Property key)
Write-Host$yy# [a, 1] [b, 2]
# return a array
Write-Host$yy.gettype()
# System.Object[]
# type of element
Write-Host$yy[0].gettype()
# System.Collections.DictionaryEntry
# get the key
Write-Host$yy[0].key
# a
# get the value
Write-Host$yy[0].value
# 1