在PowerShell中如何排序
$months = "9","12","3","7","5","6","4","8","1","10","11","2"
Write-Host "`n按字符串排序"
$months | Sort-Object # returns 1,10,11,12,2,3,4,5,6,7,8,9
Write-Host"`n按数字排序"
$months | Sort-Object { [int]$_ } # returns 1,2,3,4,5,6,7,8,9,10,11,12
日期:2020-04-11 23:04:34 来源:oir作者:oir