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

前端 未结 5 435
执笔经年
执笔经年 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 02:01

    The simple option is to use the .Name property of the FileInfo item in the pipeline and then remove the extension:

    Get-ChildItem -Path "C:\code\" -Filter *.js -r | % { $_.Name.Replace( ".js","") }
    

提交回复
热议问题