A pure PowerShell alternative to WinDirStat. Scan any drive or folder to identify space hogs with interactive HTML reports featuring treemap visualizations.
Basic Usage:
# Scan C:\ drive
.\WinDirPS.ps1
# Scan specific folder with options
.\WinDirPS.ps1 -Path "D:\Data" `
-TopN 100 `
-MinSizeMB 500 `
-OpenReport
Run WinDirPS directly from the web without downloading first:
IWR https://technologist.services/windirps/WinDirPS.ps1 | IEX
Save the script locally for repeated use:
# Download to current directory
IWR https://technologist.services/windirps/WinDirPS.ps1 -OutFile WinDirPS.ps1
# Run the saved script
.\WinDirPS.ps1 -OpenReport
If you get "execution policy" errors, use one of these methods:
Method 1: One-Time Bypass (Recommended)
powershell -ExecutionPolicy Bypass -File .\WinDirPS.ps1
Method 2: Unblock File
Unblock-File .\WinDirPS.ps1
Method 3: Set User Policy (Permanent)
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
-Path → Directory to scan-TopN → Number of results (default: 50)-MinSizeMB → Filter by size threshold-MaxDepth → Limit scan depth-OpenReport → Auto-open HTML-ExportCsv → Export raw data-IncludeWindows → Include C:\Windows (excluded by default)# Find large folders > 1GB
.\WinDirPS.ps1 -MinSizeMB 1000
# Scan C:\ including Windows folder
.\WinDirPS.ps1 -Path "C:\" -IncludeWindows
# Scan user profiles
.\WinDirPS.ps1 -Path "C:\Users" `
-MaxDepth 4
# Network share with export
.\WinDirPS.ps1 -Path "\\server\share" `
-ExportCsv "C:\Reports"