RosettaCodeData/Task/Sort-an-array-of-composite-.../PowerShell/sort-an-array-of-composite-...

10 lines
169 B
Plaintext

$list = @{
"def" = "one"
"abc" = "two"
"jkl" = "three"
"abcdef" = "four"
"ghi" = "five"
"ghijkl" = "six"
}
$list.GetEnumerator() | sort {-($PSItem.Name).length}, Name