powershell script to get the file size of files in multiple locations
top of page

powershell script to get the file size of files in multiple locations

You can run a simple PowerShell script to get the file size of files saved in various locations on a network.


Get-Childitem -file "C:\foofolder\2022.05.31 Fedex Ground.pdf" | select length

Get-Childitem -file "C:\foofolder\Citation\test\XYZ 000400.pdf" | select length

Get-Childitem -file "U:\O'Shea Documents\personal\port st. lucie.heic" | select length


Simply enter the file path in one column of an Excel spreadsheet, with the Get-Childitem -file command in the column to the left, and the | select length operator in the column to the right. Copy the three columns to NotePad and remove the tabs. Enter the script in Windows PowerShell ISE:


It will output the number of bytes in each file. [1924588 equals 1.9 MB]. You can copy the file sizes back into the Excel spreadsheet so they line up with file paths:




Recently, I used this script to get the length of hundreds of Excel files linked to on a spreadsheet for a trial exhibit list that were saved in dozens of different directories, when requested to find if a file was saved on the list under a different Bates number. The closest in size file proved to be a match.





Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page