Use PowerShell to get total size of files recursively

Here’s a one-liner in PowerShell to get the total size of all files found with wildcard pattern of *ORIGINAL*.

[math]::round((get-childitem -path . -filter "*ORIGINAL*" -file -recurse | measure-object -property length -sum).sum / 1MB, 2)

Published by

Rich

Just another IT guy.

Leave a Reply

Your email address will not be published. Required fields are marked *