使用Group-Object进行分组
对不同类型文件分组,并分别统计其数量
get-childitem | group-object extension -noelement
Count Name
----- ----
1 .android
9
1 .rnd
找出数量多于1个字符
"a", "b", "c", "c", "d" | group-object -noelement | where {$_.Count -gt 1}
Count Name
----- ----
2 c
返回唯一值
"a", "b", "c", "c", "d" | get-unique