Get folder size with its locations

Established Member

My disk gets full several times and i have to clean it manually. so , is there is any script which can tell me which folder is consuming more than 10gb with its location.



i tried this one - 


Get-ChildItem -path "C:\junk" -Directory -force -Recurse | sort -descending -property length |
Select-Object FullName |
ForEach-Object -Process{New-Object -TypeName PSObject -Property @{Name =$_.FullName;Size = (Get-ChildItem -path $_.FullName -Recurse -file -Force -ErrorAction SilentlyContinue |
Measure-Object -Property Length -Sum ).Sum/1kb}} |
Select-Object Name, @{Name="Size(MB)";Expression={("{0:N2}" -f($_.Size/1024))}}|
0 Replies