Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Comparing count and combined file sizes of specific file types in target Folder and subfolders

$
0
0

Hi all,

I have a script that I use to delete files with a certain file extension in a folder and its subfolders. I would like to enhance to the script by counting the total number of files and their combined size in MB that the script is deleting and use this information in a popup where a message will say something like "X No. Files deleted totalling YMB

The existing script so far is:
get-childitem  -include *.****.rfa -recurse | foreach ($_) {remove-item $_.fullname}
Can any advise what I need to add as I'm quite new to powershell.
Thanks

Viewing all articles
Browse latest Browse all 6937

Trending Articles