Searching through a list of folders from a text file

I am in process of searching for lets say .mp3 files in a list of folders that I have defined in a text file and then I want to export the search results in a .csv file. To accomplish all of this I have tried to create a script. The script seems to run however the output is empty. Some guidance will be appreciated, here is what the script looks like for now:

$Folders = Get-Content C:TempFoldersList.txt

Foreach ($folder in $folders) { Get-ChildItem -Recurse -Include *.mp3 | Select Directory, Name, Length | Export-CSV C:TempFileList.csv }

submitted by /u/AR0X
[link] [comments]

Leave a Reply