⚡ PowerShell 5.1+

Get Stuck print spooler files Size Report

Reports how much disk space stuck print spooler files is currently using, read-only (no deletion).

By WindowsScripting.com · 845 B
Get-SpoolerFilesSizeReport.ps1
<#
.SYNOPSIS
    Reports how much disk space stuck print spooler files is using.

.DESCRIPTION
    Recursively sums the size of every file under stuck print spooler files and prints
    a human-readable total, without deleting anything.

.EXAMPLE
    .\Get-SpoolerFilesSizeReport.ps1
#>

[CmdletBinding()]
param()

$targetPath = 'C:\Windows\System32\spool\PRINTERS'

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"