A Windows PowerShell module for analyzing and cleaning temporary files to free up disk space.
Install from PowerShell Gallery:
Install-Module -Name DiskCleaner- Get-DiskUsage - Display disk space usage with visual progress bars
- Get-TempFileInfo - Analyze temporary files and show potential space savings
- Clear-TempFiles - Safely remove temporary files (skips files in use)
- Get-RecycleBinInfo - View recycle bin size and item count
- Clear-RecycleBin - Empty the recycle bin safely
# Show all drives
Get-DiskUsage
# Show specific drive
Get-DiskUsage -Drive COutput:
=== Disk Usage ===
Drive C:
[===============...............] 48.6% used
Total: 463.29 GB
Used: 225.14 GB
Free: 238.15 GB
# Basic analysis
Get-TempFileInfo
# Include browser caches
Get-TempFileInfo -IncludeBrowserCache# Preview what would be deleted
Clear-TempFiles -WhatIf
# Clean with confirmation
Clear-TempFiles
# Clean without confirmation
Clear-TempFiles -Force
# Include browser caches
Clear-TempFiles -IncludeBrowserCache# View recycle bin info
Get-RecycleBinInfo
# Empty recycle bin with confirmation
Clear-RecycleBin
# Empty recycle bin without confirmation
Clear-RecycleBin -Force- Windows Temp folder (
%TEMP%) - User Temp folder (
%LOCALAPPDATA%\Temp) - Thumbnail cache
- Recycle Bin
- Browser caches (optional):
- Google Chrome
- Microsoft Edge
- Windows PowerShell 5.1 or PowerShell Core 7+
- Windows operating system
MIT License - see LICENSE file for details.
sumandhk - PowerShell Gallery
Contributions are welcome! Please feel free to submit a Pull Request.