⚡ PowerShell 5.1+

Get The Windows Internet cache (INetCache) Size Report

Reports how much disk space the Windows Internet cache (INetCache) is currently using, read-only (no deletion).

By WindowsScripting.com · 882 B
Get-BrowserCacheSizeReport.ps1
<#
.SYNOPSIS
    Reports how much disk space the Windows Internet cache (INetCache) is using.

.DESCRIPTION
    Recursively sums the size of every file under the Windows Internet cache (INetCache) and prints
    a human-readable total, without deleting anything.

.EXAMPLE
    .\Get-BrowserCacheSizeReport.ps1
#>

[CmdletBinding()]
param()

$targetPath = "$env:LOCALAPPDATA\Microsoft\Windows\INetCache"

if (-not (Test-Path $targetPath)) {
    Write-Host "$targetPath does not exist on this machine." -ForegroundColor Yellow
    return
}

$files = Get-ChildItem -Path $targetPath -Recurse -File -Force -ErrorAction SilentlyContinue
$totalBytes = ($files | Measure-Object -Property Length -Sum -ErrorAction SilentlyContinue).Sum

Write-Host "$targetPath" -ForegroundColor Cyan
Write-Host "  Files: $($files.Count)"
Write-Host "  Total size: $([math]::Round($totalBytes / 1MB, 2)) MB"