November 1, 2012

App-V 5 PowerShell One Liners – Sequencing an application

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 Sequencer opens up some great automation scenarios. Here’s how to use PowerShell to sequence an application without manually starting the Sequencer UI.

I’m using Paint.NET as my example application and before sequencing, I have configured an install script for this application which will automate the installation and configuration.

I’ve placed all binaries and files, including a Sequencer Template into a folder at C:\Packages. My script (INSTALL.CMD) looks like this:

START /WAIT C:\Packages\Paint.NET.3.5.10.Install.exe /skipConfig /auto PDNUPDATING=0 CHECKFORUPDATES=0 DESKTOPSHORTCUT=0

Before running the New-AppvSequencerPackage command, I have changed directory to C:\Packages. To capture Paint.NET as a new App-V 5.0 package, I have used the following command:

New-AppvSequencerPackage -FullLoad -Installer "Install.CMD" -Name "PaintNet3x" -Path "C:\Packages" -PrimaryVirtualApplicationDirectory "C:\Program Files\Paint.Net" -TemplateFilePath "AppV5SequencerTemplate.appvt" -Verbose

This generates a completed package in C:\Packages\PaintNet3x, ready for deployment to a client PC.

For more information on the New-AppvSequencerPackage command, run:

Get-Help New-AppvSequencerPackage -detailed
Print Friendly
  • Justin Mangum

    Thanks for the awesome tip on this. I’ve written an application to simplify this even more (we are preparing to package a LOT of applications, getting ready for AppV5 production) so those who don’t understand powershell or appv can use this. If you want a copy, just let me know (still polishing it a little bit at the moment)

    I found that the INSTALL.CMD can also be a simple batch file, containing many lines (install pre-reqs, merge reg files, etc etc for multipart installations), and the installation does not need to be silent.

    The application is pretty basic:
    Asks for base variables (application name, primary directory, etc)
    Asks for the installation source (main installation)
    Allows adding pre-reqs, reg files, or manual command lines

    Builds the batch file, then creates the powershell cmdlet with all the variables, and runs it.

    Written in .NET C#
    (Not advertising – I never ask for money, or even donations, on tools I write – all for the community)