Sometimes as system administrator, you find your file servers are cluttered with stuff you may want to decide to do something about, say, export to the final bin. However the case, you want to know what’s there. [and it is usually big stuff]. On windows you can ofcourse check manually, or make a list based on file extension. That’s simply how it works. It took some sites to google, but there is an abundance of file extensions out there. Most of them aren’t used, but this is a list that may be found common for multimedia files: list-mmfiles
I’m going to use this to list all multimedia files on the network now, when I miss files (by manual checking), i’ll update the list in this post.
Oh well, I skipped that, I just did :
Get-Childitem X:\ -Recurse -ErrorAction SilentlyContinue | Export-csv -Path C:\all.csv -Encoding ascii
To get all files on the system, and sort it out later, using Excel.
You can then sort on file extension.. pff, sjah.. tssss. No file size info..
I quickly looked up through the file types that were actually on the file system and ran a script that adds up all the file sizes (it does this from the path you’re in):
$totalfs = 0 $files = Get-ChildItem -Recurse -Include *3gp,*asf,*avi,*bmp,*cda,*gif,*jpg,*m1v,*m4a,*m4v,*mov,*mp3,*mp4,*mpe,*mpg,*pcx,*png,*wma,*wmf,*wmv,*wmz $totalfs = ($files | Measure-Object -Sum Length).Sum / 1GB "{0:N0}" -f $totalfs
Update: Oh and by the way, this should also list the amount of files.
(I needed that to list all txt files, actually: cookies)
$totalfs = 0 $totalfsc = 0 $files = Get-ChildItem -Recurse -Include *txt $totalfs = ($files | Measure-Object -Sum Length).Sum / 1GB $totalfsc = ($files | Measure-Object -Sum Length).Count "{0:N0}" -f $totalfs "{0:N0}" -f $totalfsc