for Whole C Drive ---------------------------------- Get-ChildItem C:\ -Directory | ForEach-Object { $size = (Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum [PSCustomObject]@{ Folder = $_.FullName Size_GB = [Math]::Round($size / 1GB, 2) } } | Sort-Object Size_GB -Descending ____________________________________ Folder Size_GB ------ ------- C:\Windows 53.89 C:\Users 25.11 C:\xamppu 22.18 C:\Drupal-Miscellneous 18.55 C:\Program Files 15.45 C:\Program Files (x86) 4.1 C:\pdf flies 1.67 C:\mysql 0.87 C:\webapps 0.52 C:\apache-jmeter-5.6.3 0.14 C:\SWSetup 0.07 C:\Poppler 0.05 C:\loadtest-artillary 0.01 C:\Intel 0 C:\composer 0 C:\PerfLogs 0 C:\react tutorial 0 C:\nvm4w 0 C:\memcached 0 _________________________________________________ Only for specified Directory checking --------------------------------------------------------------- Get-ChildItem C:\Drupal-Miscellneous | ForEach-Object { $size = (Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum [PSCustomObject]@{ Folder = $_.Name Size_GB = [Math]::Round($size / 1GB, 2) } } | Sort-Object Size_GB -Descending ----------------------------------------------------------- Only selected folder size ------------------------------------------ eg. -- C:\xamppu\htdocs\rude $size = (Get-ChildItem "C:\xamppu\htdocs\rude" -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum [PSCustomObject]@{ Folder = "rude" Size_GB = [Math]::Round($size / 1GB, 2) } ____________________________________ Array Of folder ----------------------------- $Folders = Get-ChildItem "C:\" -Directory | Select-Object -ExpandProperty FullName $Folders | ForEach-Object { $path = $_ if (Test-Path $path) { $size = (Get-ChildItem $path -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum [PSCustomObject]@{ Folder = $path Size_GB = [Math]::Round($size / 1GB, 2) } } else { [PSCustomObject]@{ Folder = $path Size_GB = "Path not found" } } } _________________________________________ for download folder --------------------------------- Get-ChildItem "$env:USERPROFILE\Downloads" | ForEach-Object { $size = (Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum [PSCustomObject]@{ Folder = $_.Name Size_GB = [Math]::Round($size / 1GB, 2) } } | Sort-Object Size_GB -Descending _____________________________________ for recycle bin -------------------------- $shell = New-Object -ComObject Shell.Application $rb = $shell.Namespace(0xA) $size = ($rb.Items() | Measure-Object Size -Sum).Sum [PSCustomObject]@{ Name = "Recycle Bin" Size_GB = [Math]::Round($size / 1GB, 2) } ______________________________________ Haan 👍 ye command time leti hai — aur ye normal baat hai. Main simple shabdon me samjhaata hoon 👇 ⏱️ Time kyun lagta hai? Ye command: Har folder ke andar Har sub-folder Har file ka size check karti hai Isliye ye complete scan karti hai. ⏳ Kitna time lag sakta hai? Depends karta hai: Disk ka size (HDD / SSD) Files ki quantity Folder depth Approx time: SSD → 2–5 minutes HDD → 5–15 minutes Bahut zyada files → 20 minutes tak ➡️ PowerShell freeze nahi hota, bas background me kaam karta hai.