List files in a directory by file type and size (powershell)

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.


Leave a Reply