Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

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 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>