as long as you have the main answer [smirk], this is a variant of the method of collecting / processing / collecting / displaying information.
it uses the -AsHashTable Group-Object parameter to build an extension lookup table. then iterates over the keys, replaces the empty extension key with the placeholder name, calculates the file size, creates [PSCustomObject] and finally sends it to the collection.
$SourceDir = $env:TEMP
output...
Extension Count Size_GB --------- ----- ------- .msi 1 0.2637 .exe 35 0.1568 .wmv 4 0.0978 .mp3 12 0.0647 .log 142 0.0579 .zip 3 0.0454 .jpg 32 0.0217 .csv 67 0.0044 .xpi 1 0.0031 .txt 116 0.0026 _No_Ext_ 7 0.0023 .part 1 0.0023 .ico 24 0.0001 .bat 18 0 .m3u8 1 0 .json 1 0 .xls 8 0 .ps1 1 0 .js 1 0 .xml 4 0 .mp4 8 0 .ani 1 0 .ini 25 0 .tmp 21 0 .bmp 1 0
source share