locked
Powershell Command for global package update? RRS feed

  • Question

  • Dear Community,

    at the moment I'm testing some packages on my development system without any App-V infrastructure in use.
    So I create my package on the sequencer and use this powershell command to publish the package:
    Add-AppvClientPackage -Path <Path to App-V Share> | Mount-AppVClientPackage | Publish-AppvClientPackage -Global

    This works fine and I'm able to test my application. But I don't know the PowerShell command to update an existing package on my system.

    Any help appreciated!

    Thanks,
    Hoba

    Thursday, March 5, 2015 8:42 AM

Answers

  • First remove the old one by the following command:

    Get-AppvClientPackage -name <packagename> -all | Stop-AppvClientPackage | Unpublish-AppvClientPackage | Remove-AppvClientPackage

    Then add the upgrade by your PowerShell command.


    • Edited by RalJans Thursday, March 5, 2015 12:39 PM
    • Marked as answer by Hoba2013 Thursday, March 5, 2015 1:31 PM
    Thursday, March 5, 2015 12:38 PM
  • We are talking different things.

    Providing a new version for an already existing package does not remove the previous from disk (for instance people might be using version 1 while other people use version 2 on the same machine).

    If you want to fully remove version 1 then yes, do the command RalJans said.  It is my understanding that the App-V client is smart enough to stream only the 'new' bits from version 2, so even though they both remain on disk you aren't necessarily eating up 2x the diskspace.  I'm sure you could override that by mounting, etc.

    As for your question about unpublishing, I've always had it recommended to perform an unpublish and remove because remove only will leave behind certain things, so unpublishing is cleaner.  And yes be careful, the -all refers to all packages on the machine, it is not part of the package name.

    I don't know what you mean by refresh options.  The way upgrading works is by 2 packages containing the same package GUID but a different package GUID that both get added|published to the same machine.  You don't have to (you also don't get to) choose which package is a new version.  For example, you may consider it a new version, but if you had to go back to the sequencer and start over from scratch, the App-V Client will not allow you to treat them as the same package.

    • Marked as answer by Hoba2013 Thursday, March 5, 2015 1:31 PM
    Thursday, March 5, 2015 1:23 PM

All replies

  • What exactly do you mean by update?

    If you mean you have version 1 of the package added to a client, and then later add version 2 and intend it to be an upgrade, the App-V Client does that for you.  Both packages must have the same package GUID (meaning you cannot start version 2 from scratch in the sequencer).

    The above command should work just fine for you.

    Thursday, March 5, 2015 12:24 PM
  • First remove the old one by the following command:

    Get-AppvClientPackage -name <packagename> -all | Stop-AppvClientPackage | Unpublish-AppvClientPackage | Remove-AppvClientPackage

    Then add the upgrade by your PowerShell command.


    • Edited by RalJans Thursday, March 5, 2015 12:39 PM
    • Marked as answer by Hoba2013 Thursday, March 5, 2015 1:31 PM
    Thursday, March 5, 2015 12:38 PM
  • Your description is correct.
    I have no Refresh Options set, so how is the App-V Client able to handle it for me?

    So I can use the above commandline to implement the update, just with the version (for example xxx_2.appv) in it?

    I tried this and it is working, but the old version is still on the disk. Do I have to Unpublish the Package first and remove it then or is the command "Remove-AppVClientPackage" enough?

    Thursday, March 5, 2015 12:41 PM
  • Dear RalJans,

    thanks for the command line.
    Can you please explain me  why I have to unpublish the Package before I remove it? Is it "wrong" just to remove it?

    And regarding your first part of the command-line "Get-AppvClientPackage -name <packagename> -all" : the "-all" refers to the <packagename>, NOT all installed packages, correct?

    Thursday, March 5, 2015 12:59 PM
  • We are talking different things.

    Providing a new version for an already existing package does not remove the previous from disk (for instance people might be using version 1 while other people use version 2 on the same machine).

    If you want to fully remove version 1 then yes, do the command RalJans said.  It is my understanding that the App-V client is smart enough to stream only the 'new' bits from version 2, so even though they both remain on disk you aren't necessarily eating up 2x the diskspace.  I'm sure you could override that by mounting, etc.

    As for your question about unpublishing, I've always had it recommended to perform an unpublish and remove because remove only will leave behind certain things, so unpublishing is cleaner.  And yes be careful, the -all refers to all packages on the machine, it is not part of the package name.

    I don't know what you mean by refresh options.  The way upgrading works is by 2 packages containing the same package GUID but a different package GUID that both get added|published to the same machine.  You don't have to (you also don't get to) choose which package is a new version.  For example, you may consider it a new version, but if you had to go back to the sequencer and start over from scratch, the App-V Client will not allow you to treat them as the same package.

    • Marked as answer by Hoba2013 Thursday, March 5, 2015 1:31 PM
    Thursday, March 5, 2015 1:23 PM
  • Thank you both for the informations!
    Thursday, March 5, 2015 1:32 PM