Set-SageSet1 PowerShell Script V1.00 | Carl Webster
A Windows utility I am surprised that a lot of admins don’t know about is Disk Cleanup. Running the Windows app doesn’t provide as many options as running the same program from the command line.
I use the command line option when finalizing master images before the provisioning process. You can also run this on manually provisioned Citrix XenApp servers.
This script automates setting all the options for running cleanmgr.exe.
In Windows 10 1803 and Server 2016 with all updates, running cleanmgr.exe /sageset:1 shows 24 options for items that can be cleaned up. These items are called Disk Cleanup Handlers. Full details can be found at Creating a Disk Cleanup Handler.
The Handlers are registered in the registry at Computer HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerVolumeCaches.
The number of entries in VolumeCaches varies by Windows version and which updates are installed. Instead of spending a couple of minutes manually selecting every item in the dialog for cleanmgr.exe, I decided to script the process. On my test virtual machines, setting all 24 entries takes less than one second.
You can always find the most current script by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/
Read the entire article here, Set-SageSet1 PowerShell Script V1.00 | Carl Webster
Via Carl Webster