For a specific folder, I need to list all files with extension .js even if nested in subfolders at any level.
.js
The result for the output console should b
If you like brevity, you can remove the ForEach-Object and quotes. -Path defaults to the current directory so you can omit it
-Path
(Get-ChildItem -Filter *.js -Recurse).BaseName | Sort length -Descending