My boss asked me to find out how many mp3 files that were hanging out on our NAS device, we’re getting a little close on storage capacity.
Below is what I came up with. The script searches the Z: (change to whatever drive letter you want to search) and finds all mp3 (*.mp3) files and outputs the results (filename, size and directory location) to the listfiles.csv file.
get-childitem z:\ -filter *.mp3 -recurse |
select-object Name, Length, directory | Sort-object Directory |
export-csv c:\scripts\listfiles.csv -notype