Browsed by
Tag: sort

Sort files by extension with total size

Sort files by extension with total size

For several reasons, it could be awesome to sort a folder and sub by extension, with the associated size for each.

 

$results=Get-ChildItem -Path "y:\" -Recurse |
#Get only files
Where-Object { !$_.PSIsContainer } |
#Group by extension
Group-Object Extension |
#Get data
Select-Object @{n="Extension";e={$_.Name -replace '^\.'}}, @{n="Size (MB)";e={[math]::Round((($_.Group | Measure-Object Length -Sum).Sum / 1MB), 2)}}, Count
$results |Sort-Object "Size (MB)"|Export-csv "$WorkingDir\Results\$ResultFile" -NoTypeInformation

 

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site