App-V 5.0 and Your PowerShell Profile

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on stumbleupon

As we all know App-V 5.0 is all about PowerShell and if you’re anything like me you’re always running your import-module appvclient command on the machines you work with.

Well today I want to share with you a handy tip that will allow you to save that time by editing your PowerShell Profile, as covered in depth in the PowerShell Owner’s Manual on TechNet.

So first things first is understanding where our PowerShell profile actually is, you do this by running the following in PowerShell:


It should return something like this:

You can check to see you already have a profile created by using:

Test-Path $profile

If it returns false we need to create a profile, this can be done by running the following:

New-Item -path $profile -type file -force

The output should be similar to below:

Now we are able to use notepad to view and edit our profile by running:

notepad $profile

Now it’s up to you what you put into this profile, for App-V we can insert the following:

Import-Module “C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\Microsoft.AppV.AppvClientComConsumer.dll”

Import-Module “C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\Microsoft.AppV.AppVClientPowerShell.dll”

Import-Module “C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\Microsoft.AppV.ClientProgrammability.Eventing.dll”

Hit save and you’re done! The next time you launch PowerShell your module will already be loaded and your first App-V command of the day will be extra quick!

Leave a Reply.

2 thoughts on “App-V 5.0 and Your PowerShell Profile”

  1. Hi,

    I am working on a application where it calls a power shell script during add package phase. As you know, we need to unrestrict(set-executionpolicy unrestricted to y) an execution policy before doing any operations in powershell command. We created a powershell script and added that script inside appv-5.0 package in the scripts tab. Added required code inside the deploymentconfig.xml file. Every thing looks good.

    But we need to use -executionpolicy bypass -file “Powershell file path” inside the deploymentconfig.xml file. As we are enabling the execution policy while adding the package why we need to add -executionpolicy bypass -file “Powershell file path” inside the deploymentconfig.xml file? If we are writing only powershell file path without exection policy bypass inside the deploymentconfig.xml, we are seeing that powershell script is not able to run.

    Can you please help!!!


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.