App-V v5 Cache Cleanup: Removing Unpublished Packages Like a Pro

Table of Contents

Hey folks! Ever find yourself wrestling with leftover App-V packages clogging up your system? You publish a package, unpublish it, and poof – the shortcuts are gone, but the package itself is still lurking in your %programdata% folder. Let’s dive into how to reclaim that precious disk space and banish unpublished App-V v5 packages for good.

App-V v5 Cache Cleanup
image just illustration

The Ghost in the Machine: Unpublished App-V Packages

So, you’ve unpublished an App-V package. The shortcuts vanish, everything seems tidy, but that package is still chilling on your hard drive like a digital ghost. Even when you stream a new version of a package, the old version sticks around, linked to the new one. It’s not necessarily a bad thing, but it can eat up disk space over time.

Unpublished Packages
image just illustration

Reclaiming Your Disk Space: The Remove-AppvClientPackage Command

The key to purging these phantom packages is the PowerShell command Remove-AppvClientPackage. Think of it as the uninstall wizard for your App-V packages. Important note: you need admin rights to run this command. Just like uninstalling regular applications!

Finding Your Targets: Identifying App-V Packages

Before you start wielding the Remove-AppvClientPackage command, you need to know what you’re targeting. That’s where Get-AppvClientPackage -All comes in handy. This command lists all packages on your computer, giving you the intel you need to remove the right ones.

Here’s the breakdown:

  • Name: The friendly name of the package.
  • PackageID: A unique identifier for the package. This is crucial for the removal process.
  • Version: The version number of the package.
  • VersionID: Another unique identifier, this time for the specific version.
  • Path: Where the package is stored on your hard drive.
  • IsPublishedToUser/Globally: Indicates whether the package is published. Unpublished packages will show as False.
  • InUse: Shows if the package is currently running. You don’t want to delete a package while someone’s using it!
  • PackageSize: The size of the package on disk. This helps you see how much space you can reclaim.

Fire up PowerShell and run Get-AppvClientPackage -All. You’ll get output similar to this:

PS C:\temp> Get-AppvClientPackage -All  

PackageId : x1x1x1x1-x1x1-x1x1-x1x1-x1x1x1x1x1x1  
VersionId : x2x2x2x2-x2x2-x2x2-x2x2-x2x2x2x2x2x2 
Name : MyVirtualPackage  
Version : 0.0.0.1  
... (other details) ...

PackageId : y1y1y1y1-y1y1-y1y1-y1y1-y1y1y1y1y1y1  
VersionId : y2y2y2y2-y2y2-y2y2-y2y2-y2y2y2y2y2y2  
Name : MyVirtualPackage  
Version : 0.0.0.2  
... (other details) ...

Executing the Removal: Banishing the Packages

Now that you have the PackageID, you can unleash the Remove-AppvClientPackage command. Let’s say you want to remove the older version (0.0.0.1) of “MyVirtualPackage” with the PackageID x1x1x1x1-x1x1-x1x1-x1x1-x1x1x1x1x1x1. In your PowerShell window, enter:

Remove-AppVClientPackage -PackageId x1x1x1x1-x1x1-x1x1-x1x1-x1x1x1x1x1x1 

Important: Make sure to replace x1x1x1x1-x1x1-x1x1-x1x1-x1x1x1x1x1x1 with the actual PackageID you want to remove.

Nuclear Option: Removing All Packages

Feeling bold? Want to wipe the slate clean? You can remove all packages, regardless of their publishing status, with this command:

Get-AppvClientPackage -All | Remove-AppvClientPackage

This command pipes the output of Get-AppvClientPackage -All (which lists all packages) into Remove-AppvClientPackage, effectively removing everything. Use with caution!

A Clean Slate: Enjoy Your Reclaimed Disk Space!

And there you have it! You’ve successfully purged those lingering App-V packages and reclaimed your valuable disk space. Now your system is leaner, meaner, and ready for action.

We hope this guide helped you navigate the sometimes-murky waters of App-V package management. If you have any questions, tips, or war stories about App-V cleanup, feel free to share them in the comments below. Happy cleaning!

Post a Comment