As I saw more potential for this method of utilizing the Disk Cleanup tool, I decided to write a proper module that does simplifies the job creation process beyond just cleaning up Previous Windows Installation / Upgrade files. Today I have released the module that does the following:

 

This module is actively maintained on GitHub: 

GitHub - JaapBrasser - DiskCleanup

And it is also available on the PowerShell Gallery:

PowerShell Gallery - DiskCleanup

 

Version 1.0.0 - Initial Upload

Version 1.1.0 - Added parameter