-
Set-SageSet1 PowerShell Script V1.10
My Windows 10 management VM received the 1809 release. In the Disk Cleanup utility (cleanmgr.exe), Microsoft added the Downloads folder to the list of items that can be cleaned.
That may not be a good thing because if you run V1.00 of this script, or just blindly select every checkbox, you can find yourself missing all your downloaded files.
In this update, I added a -Downloads switch parameter. The parameter is $False by default so the DownloadsFolder is excluded. If you use -Downloads, that sets the switch to True which will cause the DownloadsFolder to be selected and then cleaned up the next time you run cleanmgr /SageRun:1.
I also added a -Reset witch parameter. If you use this switch, the script will set all items in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches to 0 which means the checkbox is unselected.
Figure 1 shows the initial run of cleanmgr /SageSet:1. Running the script with no parameters, as shown in Figure 2, results in all but the Downloads item selected, as shown in Figure 3.
Using -Downloads will also select Downloads as shown in Figures 4 and 5.
Using -Reset will set all the items in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches to 0, as shown in Figures 6 and 7.
I hope you find the updated script useful, especially for keeping your computer, servers, and master images for Citrix XenApp/XenDesktop, VMware Horizon, Microsoft RDS, and Parallels RAS clean and disk space usage down.
Thanks
Webster
December 15, 2018
Citrix Virtual Apps and Desktops, PowerShell, XenApp 6.0, XenApp 6.5, XenApp/XenDesktop 7.0 - 7.7, XenDesktop 5.x