Installing the new App-V 5 PowerShell Modules

Following on from the release of the Virtual Engine App-V 5.0 PowerShell CmdLets, I thought I best give you a quick run through on setting them up! Installing the PowerShell modules is easy, regardless of whether you’re installing them just for your user account or on a per machine basis. Note: we will package these up into a .MSI once we’ve had some initial feedback and fixed any “features!”

Per User Installation

To install the new modules on a per-user basis, extract the files into your ‘Documents\WindowsPowerShell\Modules\’ directory:

image

Per Computer Installation

To install the new modules on a per-computer basis, extract the files into the ‘C:\Windows\System32\WindowsPowerShell\v1.0\Modules\’ (or %PSModulePath% for short!) directory:

image

Importing

To import and use the modules, simply run the following PowerShell command (they are digitally signed):

Import-Module VirtualEngine-AppV5

You may be prompted to confirm that you trust the publisher  (!?). The modules are digitally signed. If you want to use them, then you better ensure that you select the ‘Always Run’ (or at lease ‘Run Once’) option!

PowerShell_Trusted_Publisher

Once they’re loaded you can check by running the following PowerShell command. If you see something similar to this then you should be all set:

PS C:\Windows\system32> Get-Command -Module VirtualEngine*

CommandType     Name                                      ModuleName
-----------     ----                                      ----------
Function        Get-AppV5File                             VirtualEngine-AppV5
Function        Get-AppV5FilePackage                      VirtualEngine-AppV5
Function        Get-AppV5FileReport                       VirtualEngine-AppV5
Function        Get-AppV5FileXml                          VirtualEngine-AppV5
Function        Get-AppV5FileXmlPackage                   VirtualEngine-AppV5
Function        Get-VEAppV5Version                        VirtualEngine-AppV5
Function        Save-AppV5File                            VirtualEngine-AppV5
Function        Save-AppV5FileReport                      VirtualEngine-AppV5
Function        Save-AppV5FileXml                         VirtualEngine-AppV5
Function        Save-AppV5FileXmlPackage                  VirtualEngine-AppV5

PS C:\Windows\system32> 

Note: The modules require PowerShell 3.0 and the Microsoft .Net Framework 4.5. These are installed by default on Windows 8 and Windows Server 2012. If you’re running Windows 7 without these requirements, then you’ll receive errors. Make sure you meet these requirements.

5 Comments

  1. Ignacio Renuncio Author December 5, 2014 (9:51 am)

    Hi Iain,

    I’ve found your module looking for a standalone Powershell installer/uninstaller of AppV5 apps.

    After some debugging I made the following chages to your code:

    LINE 186
    Change the final [System.IO.FileMode]::Open)); for [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read)); to be able to open read-only AppV files.

    LINE 634
    Same change as line 186

    LINE 197
    Remove the final -ForegroundColor Red as it causes an error

    With these three modifications the code Works like a charm and lets me choose an AppV file and dynamically get its PackageId property (in order to be able to unsinstall it).

    Thanks a lot for the hard work.

  2. Iain Brighton Author February 6, 2015 (5:17 pm)

    Hi Ignacio, thanks for the feedback. The cmdlets have been rewritten with some additional goodness. Hopefully they’ll be out soon (once the help and testing has been completed). Regards, Iain

  3. Rory Author February 2, 2016 (5:26 am)

    Was an update for the cmdlets done? Will be testing with App-V 5.1.

  4. Iain Brighton Author February 3, 2016 (9:46 pm)

    Hi Rory – no not yet. The cmdlets have been rewritten in C# but are not publically available yet. Is there anything in particular that you’re interested in? Thanks, Iain

  5. Rory Author March 23, 2016 (9:22 pm)

    Just wanting to get the latest version with fixes before I start using them.

Leave a Reply

Archives

Categories