Run PowerShell as Administrator
Define the path to the Disk Cleanup Manager
$cleanmgrPath = “$env:SystemRoot\System32\cleanmgr.exe”
Run Disk Cleanup with the system cleanup option
Start-Process $cleanmgrPath -ArgumentList “/sageset:65535 /sagerun:65535” -Wait
Clean up system files including Windows.old
Start-Process $cleanmgrPath -ArgumentList “/sagerun:65535 /cleanup:30” -Wait
Pararmater to pick Windows update cleanup and other options