App-V 5 PowerShell One Liners – Adding and Publishing A Folder of App-V Client Packages

App-V 5.0 is PowerShell driven, which means opportunity for automating and scripting tasks that might have to be completed manually or might have been a challenge to script previously.

Using PowerShell to drive the App-V Client opens up plenty of great scenarios. I’ve previously posted on how to add, publish and stream a single package with a one line of PowerShell, but it might also be useful to import a number of packages the same way.

This is simple with a slight modification of the original command line with the use of Get-ChildItem to return a list of .appv files from a folder. Adding the -recurse switch walk through a complete folder structure and return .appv files from sub-folders.

Here’s how to use PowerShell to import packages stored in their own folder (i.e. sub-folders) in a UNC, publish them globally and stream each package into the local cache.

Get-ChildItem "\\Server\Share\Packages" -recurse -force -include *.appv | Add-AppvClientPackage | Publish-AppvClientPackage -global | Mount-AppvClientPackage

Teamed with NTFS permissions on each package folder, this command is a (very) simple, roll your own publishing tool for App-V 5.