This script is used to clean up the disk space on a Windows machine. This is compatible with Windows 10+, Windows Server 2012 R2+, and limited support for Windows Server 2008 R2.
The script can be run in two ways:
- Report Mode - This mode will run the script and output a report of useful information to help with manual cleanup.
- Cleanup Mode - This mode will run the script and perform the cleanup automatically.
You can run the script by opening an Administrative PowerShell window and running the following command depending on the mode you want to run:
# Requires PowerShell 3.0+
## If you receive a 'iwr : The request was aborted: Could not create SSL/TLS secure channel.' error, enter the below:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
## Report Mode
iex (iwr 'https://raw.githubusercontent.com/name/disk-cleanup/main/disk-cleanup.ps1')
## Cleanup Mode
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/name/disk-cleanup/main/disk-cleanup.ps1' -OutFile 'disk-cleanup.ps1' ; & '.\disk-cleanup.ps1' -clean