How to retrieve recursively any files with a specific extensions in PowerShell?

前端 未结 5 444
执笔经年
执笔经年 2020-12-24 01:34

For a specific folder, I need to list all files with extension .js even if nested in subfolders at any level.

The result for the output console should b

5条回答
  •  抹茶落季
    2020-12-24 01:49

    If you like brevity, you can remove the ForEach-Object and quotes. -Path defaults to the current directory so you can omit it

    (Get-ChildItem -Filter *.js -Recurse).BaseName | Sort length -Descending
    

提交回复
热议问题