我在PowerShell中有一个哈希表,看起来像这样:
Profil = @{
"Jason" = "P2, P4, P1";
"Mick" = "P1";
"Rocky" = "P4, P5";
"Natasha" = "P9, P4, P1"
}
我需要去除空格并按以下方式排序:
Profil = @{
"Jason" = "P1,P2,P4";
"Mick" = "P1";
"Rocky" = "P4,P5";
"Natasha" = "P1,P4,P9"
}
我尝试使用
foreach($value in $Profil.GetEnumerator() | Sort Value) {$value.Value}
但不起作用。