Windows Powershell排序和分组管道结果示例 使用Sort-Object和Group-Object可以对管道结果进行分组。 其实每条命令执行后的结果已经排过序了。例如通过ls 查看文件列表,默认会根据Name属性进行排序,但是你可以通过指定 属性进行排序: 例如: PS C:\wang\VB_family\VBA\tool2> ls | Sort-Object Length Directory: C:\wang\VB_family\VBA\tool2 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 2023/09/28 19:38 48 .gitignore -a--- 2023/09/28 19:38 315 package.json -a--- 2023/09/28 19:39 360 config.json -a--- 2023/09/28 20:42 10366 test.xlsx -a--- 2023/09/28 20:42 21547 test.xlsm d----...