Author: Jim Tyler
Twitter: @jimrtyler
GitHub: @jimrtyler
YouTube: @PowerShellEngineer
DiskCleaner is a user-friendly PowerShell GUI script designed to analyze and clean up unnecessary files on your system, freeing up valuable disk space. It leverages PowerShell's capabilities with Windows Forms to provide an interactive, graphical interface, making disk cleanup tasks accessible even to non-technical users.
- Open PowerShell as Administrator
- Download the script and read it before you run it:
Invoke-WebRequest 'https://raw.githubusercontent.com/jimrtyler/diskcleaner/main/DiskCleanerStandalone.ps1' -OutFile .\DiskCleanerStandalone.ps1 Get-Content .\DiskCleanerStandalone.ps1 . .\DiskCleanerStandalone.ps1
- See what it would delete first, then run it for real:
Clear-DriveJunk -DriveLetter "C" -LogFile ".\diskcleaner.log" Clear-DriveJunk -DriveLetter "C" -ActuallyDeleteFiles $true -LogFile ".\diskcleaner.log"
- Open PowerShell as Administrator.
- Run the script:
.\DiskCleaner.ps1
- Interactive GUI: Intuitive Windows Forms interface for easy use.
- Drive Selection: Select any available drive on your system for analysis.
- Space Analysis: Display total and free space of the selected drive.
- Junk File Detection: Calculate and display the size of unnecessary files that can be removed.
- Disk Cleaning: Remove unnecessary files with a single button click.
- Logging: All actions and details are logged to a file for transparency.
- Browser Detection: Prevent cleanup if browsers are running to avoid potential data loss.
- PowerShell Version: 5.1 or later
- Operating System: Windows
- Modules: Ensure
ClearDiskJunk.psm1is in the same directory as the script.
- Clone or download the repository to your local machine:
git clone https://github.com/jimrtyler/DiskCleaner.git
--