--- title: How to Manage App-V 5.0 Packages Running on a Stand-Alone Computer by Using PowerShell description: How to Manage App-V 5.0 Packages Running on a Stand-Alone Computer by Using PowerShell author: jamiejdt ms.assetid: 1d6c2d25-81ec-4ff8-9262-6b4cf484a376 ms.pagetype: mdop, appcompat, virtualization ms.mktglfcycl: deploy ms.sitesec: library ms.prod: w10 ms.date: 08/30/2016 --- # How to Manage App-V 5.0 Packages Running on a Stand-Alone Computer by Using PowerShell The following sections explain how to perform various management tasks on a stand-alone client computer by using PowerShell: - [To return a list of packages](#bkmk-return-pkgs-standalone-posh) - [To add a package](#bkmk-add-pkgs-standalone-posh) - [To publish a package](#bkmk-pub-pkg-standalone-posh) - [To publish a package to a specific user](#bkmk-pub-pkg-a-user-standalone-posh) - [To add and publish a package](#bkmk-add-pub-pkg-standalone-posh) - [To unpublish an existing package](#bkmk-unpub-pkg-standalone-posh) - [To unpublish a package for a specific user](#bkmk-unpub-pkg-specfc-use) - [To remove an existing package](#bkmk-remove-pkg-standalone-posh) - [To enable only administrators to publish or unpublish packages](#bkmk-admins-pub-pkgs) - [Understanding pending packages (UserPending and GlobalPending)](#bkmk-understd-pend-pkgs) ## To return a list of packages Use the following information to return a list of packages that are entitled to a specific user: **Cmdlet**: Get-AppvClientPackage **Parameters**: -Name -Version -PackageID -VersionID **Example**: Get-AppvClientPackage –Name “ContosoApplication” -Version 2 ## To add a package Use the following information to add a package to a computer. **Important**   This example only adds a package. It does not publish the package to the user or the computer.   **Cmdlet**: Add-AppvClientPackage **Example**: $Contoso = Add-AppvClientPackage \\\\path\\to\\appv\\package.appv ## To publish a package Use the following information to publish a package that has been added to a specific user or globally to any user on the computer.
Publishing method Cmdlet and example

Publishing to the user

Cmdlet: Publish-AppvClientPackage

Example: Publish-AppvClientPackage “ContosoApplication”

Publishing globally

Cmdlet: Publish-AppvClientPackage

Example: Publish-AppvClientPackage “ContosoApplication” -Global

  ## To publish a package to a specific user **Note**   You must use App-V 5.0 SP2 Hotfix Package 5 or later to use this parameter.   An administrator can publish a package to a specific user by specifying the optional **–UserSID** parameter with the **Publish-AppvClientPackage** cmdlet, where **-UserSID** represents the end user’s security identifier (SID). To use this parameter: - You can run this cmdlet from the user or administrator session. - You must be logged in with administrative credentials to use the parameter. - The end user must be logged in. - You must provide the end user’s security identifier (SID). **Cmdlet**: Publish-AppvClientPackage **Example**: Publish-AppvClientPackage “ContosoApplication” -UserSID S-1-2-34-56789012-3456789012-345678901-2345 ## To add and publish a package Use the following information to add a package to a computer and publish it to the user. **Cmdlet**: Add-AppvClientPackage **Example**: Add-AppvClientPackage \\\\path\\to\\appv\\package.appv | Publish-AppvClientPackage ## To unpublish an existing package Use the following information to unpublish a package which has been entitled to a user but not remove the package from the computer. **Cmdlet**: Unpublish-AppvClientPackage **Example**: Unpublish-AppvClientPackage “ContosoApplication” ## To unpublish a package for a specific user **Note**   You must use App-V 5.0 SP2 Hotfix Package 5 or later to use this parameter.   An administrator can unpublish a package for a specific user by using the optional **–UserSID** parameter with the **Unpublish-AppvClientPackage** cmdlet, where **-UserSID** represents the end user’s security identifier (SID). To use this parameter: - You can run this cmdlet from the user or administrator session. - You must be logged in with administrative credentials to use the parameter. - The end user must be logged in. - You must provide the end user’s security identifier (SID). **Cmdlet**: Unpublish-AppvClientPackage **Example**: Unpublish-AppvClientPackage “ContosoApplication” -UserSID S-1-2-34-56789012-3456789012-345678901-2345 ## To remove an existing package Use the following information to remove a package from the computer. **Cmdlet**: Remove-AppvClientPackage **Example**: Remove-AppvClientPackage “ContosoApplication” **Note**   App-V cmdlets have been assigned to variables for the previous examples for clarity only; assignment is not a requirement. Most cmdlets can be combined as displayed in [To add and publish a package](#bkmk-add-pub-pkg-standalone-posh). For a detailed tutorial, see [App-V 5.0 Client PowerShell Deep Dive](https://go.microsoft.com/fwlink/?LinkId=324466).   ## To enable only administrators to publish or unpublish packages **Note**   **This feature is supported starting in App-V 5.0 SP3.**   Use the following cmdlet and parameter to enable only administrators (not end users) to publish or unpublish packages:

Cmdlet

Set-AppvClientConfiguration

Parameter

-RequirePublishAsAdmin

Parameter values:

  • 0 - False

  • 1 - True

Example:: Set-AppvClientConfiguration –RequirePublishAsAdmin1

  To use the App-V Management console to set this configuration, see [How to Publish a Package by Using the Management Console](how-to-publish-a-package-by-using-the-management-console-50.md). ## Understanding pending packages (UserPending and GlobalPending) **Starting in App-V 5.0 SP2**: If you run a PowerShell cmdlet that affects a package that is currently in use, the task that you are trying to perform is placed in a pending state. For example, if you try to publish a package when an application in that package is being used, and then run **Get-AppvClientPackage**, the pending status appears in the cmdlet output as follows:
Cmdlet output item Description

UserPending

Indicates whether the listed package has a pending task that is being applied to the user:

  • True

  • False

GlobalPending

Indicates whether the listed package has a pending task that is being applied globally to the computer:

  • True

  • False

  The pending task will run later, according to the following rules:
Task type Applicable rule

User-based task, e.g., publishing a package to a user

The pending task will be performed after the user logs off and then logs back on.

Globally based task, e.g., enabling a connection group globally

The pending task will be performed when the computer is shut down and then restarted.

  For more information about pending tasks, see [About App-V 5.0 SP2](about-app-v-50-sp2.md#bkmk-pkg-upgr-pendg-tasks). **Got a suggestion for App-V**? Add or vote on suggestions [here](http://appv.uservoice.com/forums/280448-microsoft-application-virtualization). **Got an App-V issu**e? Use the [App-V TechNet Forum](https://social.technet.microsoft.com/Forums/home?forum=mdopappv). ## Related topics [Operations for App-V 5.0](operations-for-app-v-50.md) [Administering App-V by Using PowerShell](administering-app-v-by-using-powershell.md)