Which app-v cmdlet would you use to stream an application to a logged in user?

To simplify creating a Liquit Workspace package for an App-V package of PuTTY, I’ve included a PowerShell script at the end of this blog.

This PowerShell script can be changed easily, to use it with any App-V package you would like to distribute and use from within Liquit Workspace. It creates a Smart Icon with all actions needed to enable App-V, publish, unpublish and remove the App-V package for PuTTY as demonstrated in this video:

The actions which are used to support App-V have been divided in an Install, Launch and Uninstall action set:

  • Install uploaded PuTTY 0.73.appv

    This action copies ‘PuTTY 0.73.appv’ to ${PackageTempDir}PuTTY 0.73.appv. This directory translates to %LOCALAPPDATA%Temp

  • Enable-Appv

    This action uses the Enable-Appv cmdlet to enable the Microsoft Application Virtualization (App-V) service on Windows 10 Enterprise or Education

    Enabling the App-V client and UE-V client in Windows 10 Enterprise Build 14316 via PowerShell and viewing the behaviour of filter drivers for each client.

    If you’re following Microsoft App-V and User Experience Virtualization (UE-V), then you’re probably aware that these products are being built into Windows 10 Enterprise (and presumably Windows Server 2016). This means no longer having to download and install each client - it will already be available in Windows and just requires enabling to use.

    I previously tweeted a view of the App-V and UE-V client files available in the latest build:

    #AppV and #UEV in the latest Windows 10 builds pic.twitter.com/rv3EG0zIFX— Aaron Parker (@stealthpuppy) April 8, 2016

    Filter Drivers

    Before we enable the clients, let’s take a quick look at the filter drivers in Windows 10 build 14136 (note, I’m looking at a VM with the Office 365 apps installed, so I may have picked up a filter driver or two already). The fltmc command from an elevated Command Prompt or PowerShell instance displays the currently running filters:

    Which app-v cmdlet would you use to stream an application to a logged in user?

    Enabling the App-V Client

    If we take a look at services on the client, we can see that the App-V Client service exists but is not enabled. To view the status of the service run:

    Get-Service | Where-Object { $_.Name -like "appv*" } | Select Name, DisplayName, Status, StartType | Format-List
    

    Which app-v cmdlet would you use to stream an application to a logged in user?

    The App-V PowerShell module included in Windows 10 includes an Enable-AppV command. To use the command to enable the App-V client, first run an elevated PowerShell prompt. Import the AppvClient module and run the command:

    Import-Module AppvClient
    Enable-AppV
    

    Unfortunately, at this time, the cmdlet does not return anything - neither True or False or anything else depending on the result. This will be important for validating automation, so hopefully, Microsoft will fix that before release. Once the cmdlet is successful the App-V Client service will be enabled an running, so it is possible to check whether the service has been enabled to see whether Enable-AppV was successful.

    Unlike fellow MVP Ryan Bijkerk, I did not run into issues running this command, but if the cmdlet fails to enable the App-V client, you can enable the service with the following commands:

    Set-Service -Name AppVClient -StartupType Automatic
    Start-Service AppVClient
    

    If we again take a look at the filter drivers running, a number of App-V related drivers have been added. Here we can see that the following filter drivers have been enabled:

    • AppvVfs (App-V virtual file system)
    • AppvStrm (App-V streaming driver)
    • AppvVemgr (App-V virtual environment manager)

    Which app-v cmdlet would you use to stream an application to a logged in user?

    Enabling the UE-V Client

    Just like the App-V client, we can see that the UE-V client service exists but is disabled. Use the Get-Service command to see the status of the service:

    Get-Service | Where-Object { $_.Name -like "uev*" } | Select Name, DisplayName, Status, StartType | Format-List
    

    Which app-v cmdlet would you use to stream an application to a logged in user?

    Viewing the UE-V client service.Use the Enable-Uev cmdlet to enable the UE-V client:

    Import-Module UEV
    Enable-Uev
    

    Again, like Enable-AppV,

    Import-Module AppvClient
    Enable-AppV
    
    1 returns nothing, you can view the status of the UE-V Client service to see whether it was successfully enabled. If the command fails for whatever reason, enable the UE-V client service directly:

    Set-Service -Name AppVClient -StartupType Automatic; Start-Service AppVClient
    

    Now lets again look at the filter drivers that have been added - just a single driver for UE-V:

    • UevAgentDriver

    Which app-v cmdlet would you use to stream an application to a logged in user?

    Disabling the App-V and UE-V Clients

    As you would expect with Enable-AppV and Enable-UEV, there are cmdlets for disabling both clients. Again from an elevated PowerShell instance, run:

    Import-Module AppVClient
    Import-Module UEV
    Disable-Appv
    Disable-Uev
    

    Once run the services for both clients will be stopped:

    Which app-v cmdlet would you use to stream an application to a logged in user?

    Once disabled, we would expect the filter drivers to be unloaded - the UE-V filter driver is unloaded immediately; however, the filter drivers for App-V are not unloaded until Windows restarts.

    From what I understand, even though the client services are stopped, requests will still be passed through the filter drivers (I reserve the right to be wrong though…). To unload the filter drivers immediately, use the fltmc unload command:

    fltmc unload AppvVfs
    fltmc unload AppvStrm
    fltmc unload AppvVemgr
    

    This approach might break applications, so use for testing purposes only. A reboot after disabling these clients is recommended.

    Finally

    This is the first build of Windows 10, available to testers, where the App-V and UE-V clients are built in. While Group Policy will also be an option for enabling these services en masse, doing via PowerShell is still useful for some scenarios.

    In going through this exercise, there are two things that stand out:

    • The Enable and Disable cmdlets should return a True or False if the command was successful or not. This is expected to be fixed before release. [24th April 2016 - build 14328 has updated the cmdlets to return a status]
    • I would like to see the App-V and UE-V clients enable and disabled as Windows Features (to enable/disable via DISM or ‘Programs and Features’), rather than just be in-box disabled. I’m not confident that this approach will change.

    If you are a Windows Insider, I would recommend testing the App-V and UE-V functionality delivered as a part of this build. In addition, if you encounter challenges or bug, be sure to log them on Connect.

    What is App

    App-V virtual environments in Configuration Manager allow virtual applications that you have deployed to share the same file system and registry on client computers. This means that unlike standard virtual applications, these applications can share data with each other.

    Where are App

    App-V Client data storage locations.

    How does App

    The App-V Desktop Client on the users' endpoint device retrieves virtual apps and publishes apps to the computer. When users turn on their device, the Desktop Client automatically makes the virtual environment available on the Windows endpoint.

    Which of the following are the features of the App

    The App-V server consists of the following features: Management Server—provides overall management functionality for the App-V infrastructure. Management Database—facilitates database predeployments for App-V management. Publishing Server—provides hosting and streaming functionality for virtual applications.