PowerShell Script–Set App-V 4.6 Cache Size

Background: As part of our migration process from Configuration Manager 2007 to Configuration Manager 2012 R2 we also adjust the App-V Cache Size that is currently set to 6GB to 11GB because the ConfigMgr Agent Cache is set to 10GB, this by following the best practice described in Microsoft’s whitepaper Virtual Application Management with Microsoft Application Virtualization 4.5/4.6 and System Center Configuration Manager 2007 R2 where it says.

“The App-V Client cache free disk space threshold parameter should be set to ensure that the available disk space on the client PC is at least 1 GB larger than the Configuration Manager Client cache size.”

The actual change of the App-V cache is not done through PowerShell itself but set using the Microsoft appvcachesize.exe utility. I used this utility based on the explanations provided in the blog post from Kirx About the App-V Client Cache size not being (fully) controlled by the Registry Value FileSize

Because I am getting a lot from the community, I wanted to give something back and therefore created a standalone script of the code that changes the App-V Cache size that i have embedded in our larger ConfigMgr migration script which I might share at a later point in time.

The below script Set’-AppVCacheSize.ps1 dos the following.

  1. Copies the appvcachesize.exe to the targeted remote machine
  2. Retrieves the current App’-V Cache file and size settings
  3. Changes the App-V Cache size to the size specified
  4. Displays the new App-V Cache file and size settings

Important! You must store the appvcachesize.exe within the same folder where the PowerShell script is stored.

Also note that the script is using PowerShell remoting for all actions, so having WinRM enabled on the target machines is a must.

Examples of possible execution modes are documented within the Script.

Leave a Reply