PowerShell: Sum of selected file sizes March 14, 2019 12:38 pm \ by John Perry $FilesToDelete = Get-ChildItem -Path "$TopPath\*" -Include *.safe, *.bak, *.trn, *.log -Recurse ($FilesToDelete |Measure-Object -property length -sum).Sum / 1MB Posted in: PowerShell