<< Back to Script Library

APPV5: Publish Package (Global)

This SBA will publish an App-V package globally
Version: 2.5.8
Created: 2015-06-19
Modified: 2022-10-12
Creator: Nathan Sperry
Downloads: 129
Tags: App-V Global Publish
The Script Copy Script Copied to clipboard

$ErrorActionPreference = 'Stop'

# Check if App-V client is installed
Function Get-AppVClient{

    This function determines if the App-V client is installed
    This function determines if the App-V client is installed
    Returns true or false.
    NAME: Get-AppVClient
    AUTHOR: Nathan Sperry, Virtual Engine
    LASTEDIT: 05/06/2015
    WEBSITE: http://www.virtualengine.co.uk
    KEYWORDS: App-V,App-V ,VirtualEngine,AppV5

    ## TTYE - check if this is the built-in AppV
    if ([boolean](Get-Command -Name Get-AppvStatus -ErrorAction SilentlyContinue)) {
        if ((Get-AppvStatus).AppVClientEnabled -eq $true) {
            return $true

    $Installed = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | where Displayname -match 'Microsoft Application Virtualization' | Select-Object Displayname

    if ($Installed -ne $null) {
        return $true
    } else {
        return $false

if (Get-AppVClient -eq $true) {
    If ( (Get-Module -Name AppvClient -ErrorAction SilentlyContinue) -eq $null ) {
            # using try/catch can stop the script completely if needed with "Exit with error" - 'Exit 1' (or some other non-zero exit code)
            # and avoid a long string of errors because the first statement was not successful.
            Try {
                    Import-Module AppvClient
            } Catch {
                    Write-Host "There is a problem loading the Powershell module. It is not possible to continue."
                    Exit 1

Sync-AppvPublishingServer -ServerId 1 -global