Get folder size with its locations

%3CLINGO-SUB%20id%3D%22lingo-sub-2738794%22%20slang%3D%22en-US%22%3EGet%20folder%20size%20with%20its%20locations%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2738794%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20disk%20gets%20full%20several%20times%20and%20i%20have%20to%20clean%20it%20manually.%20so%20%2C%20is%20there%20is%20any%20script%20which%20can%20tell%20me%20which%20folder%20is%20consuming%20more%20than%2010gb%20with%20its%20location.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20tried%20this%20one%20-%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CSPAN%3EGet-ChildItem%20-path%20%22C%3A%5Cjunk%22%20-Directory%20-force%20-Recurse%20%7C%20sort%20-descending%20-property%20length%20%7C%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ESelect-Object%20FullName%20%7C%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EForEach-Object%20-Process%7BNew-Object%20-TypeName%20PSObject%20-Property%20%40%7BName%20%3D%24_.FullName%3BSize%20%3D%20(Get-ChildItem%20-path%20%24_.FullName%20-Recurse%20-file%20-Force%20-ErrorAction%20SilentlyContinue%20%7C%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EMeasure-Object%20-Property%20Length%20-Sum%20).Sum%2F1kb%7D%7D%20%7C%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ESelect-Object%20Name%2C%20%40%7BName%3D%22Size(MB)%22%3BExpression%3D%7B(%22%7B0%3AN2%7D%22%20-f(%24_.Size%2F1024))%7D%7D%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EOut-GridView%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2738794%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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))}}|
Out-GridView
1 Reply

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))}} | Where-Object 'Size(MB)' -GT 9.99 |
Out-GridView

Where-Object 'Size(MB)' -GT 9.99 was the thing that I added at the end, did this work for you?