Is there a way to keep the order of keys in a hashtable as they were added? Like a push/pop mechanism.
Example:
$hashtable = @{} $hashtable.Add(\"Sw
Here is a simple routine that works for me.
function sortedKeys([hashtable]$ht) { $out = @() foreach($k in $ht.keys) { $out += $k } [Array]::sort($out) return ,$out }
and the call to use it
forEach($k in (& sortedKeys $ht)) { ... }