Stop Wasting Time Clicking "Properties": A PowerShell Script to Find Folders Over 1GB

Windows disk management is fundamentally broken. When your C: drive turns red, the native tools are useless. Clicking "Properties" on every single folder to see what is eating your storage is a massive waste of time.

You need automation. You need to see exactly where the heavy data lives without digging through nested directories.

Here is a straightforward PowerShell script that scans a specific path, calculates the size of every subfolder, and prints a clean, visual tree of anything over 1GB.

The Script

Copy this directly into your PowerShell environment or save it as a .ps1 file

The PowerShell Script

function Get-FolderTreeSize {
    param (
        [string]$Path = "C:\",
        [int]$Level = 0,
        [double]$MinSizeGB = 1
    )

    $folders = Get-ChildItem -Path $Path -Directory -ErrorAction SilentlyContinue

    foreach ($folder in $folders) {
        $size = (Get-ChildItem $folder.FullName -Recurse -File -ErrorAction SilentlyContinue |
                 Measure-Object Length -Sum).Sum

        $sizeGB = $size / 1GB

        # Show only if greater than 1 GB
        if ($sizeGB -ge $MinSizeGB) {
            $indent = "  " * ($Level * 2)
            $sizeFormatted = [math]::Round($sizeGB, 2)

            Write-Output "$indent|-- $($folder.Name) [$sizeFormatted GB]"

            # Go deeper only for large folders
            Get-FolderTreeSize -Path $folder.FullName -Level ($Level + 1) -MinSizeGB $MinSizeGB
        }
    }
}

# Run for Program Files
Get-FolderTreeSize -Path "C:\Program Files" -MinSizeGB 1

How It Works

This is not a complex script, but it is highly efficient. Here is exactly what it is doing

  • Targeted Scanning ($Path): It starts at your designated path. The example above defaults to checking C:\Program Files.

  • Silent Error Handling (-ErrorAction SilentlyContinue): Windows will block access to system or hidden folders. This parameter tells the script to ignore those access denied errors and keep moving, rather than filling your screen with red text.

  • Math on the Fly (Measure-Object): It looks inside every folder, grabs the byte size of every file, adds them up, and divides by 1GB to give you a readable number.

  • Recursive Logic (Get-FolderTreeSize calls itself): If it finds a folder over 1GB, it dives into that specific folder to see what is causing the bloat, automatically indenting the output so you can read it like a map.

How to Run It

  1. Open Windows PowerShell (Run as Administrator if you want to scan restricted system folders).

  2. Paste the entire block of code above and press Enter.

  3. The script will immediately output a clean list of every folder over 1GB in your Program Files.

If you want to scan your entire C:\ drive instead, just change the last line to: Get-FolderTreeSize -Path "C:\" -MinSizeGB 1