• Conversant Group
    Conversant Group

    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.

    Figure 1
    Figure 1

    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.

    Figure 2
    Figure 2
    Figure 3
    Figure 3

    Using -Downloads will also select Downloads as shown in Figures 4 and 5.

    Figure 4
    Figure 4
    Figure 5
    Figure 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.

    Figure 6
    Figure 6
    Figure 7
    Figure 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







    Conversant Group
    Conversant Group

    About Carl Webster

    Webster is a Sr. Infrastructure Consultant for Conversant Group and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

    View all posts by Carl Webster

    No comments yet.

    Leave a Reply