Home > App-V, PowerShell Scripting > Quickly delete and re-stream an App-V application with Powershell

Quickly delete and re-stream an App-V application with Powershell

I get this problem quite a bit in our environment so threw together a quick Powershell script.

A tech will add revision after revision to an App-V package in the development lifecycle, but when it goes live to production the revisions are so far apart the application rarely works using the cached version even after an sfttray /loadall.

Here’s a quick Powershell script to cleanly remove and read an application:

The usage is below:

update-appvpackage -path "\\server\contentshare" -package "packagename"

This script assumes you use the best practices on your content share. .e.g. \\contentshare\appname\appname_manifest.xml. If you don’t use this practice, this script wont work for you.

function update-appvpackage{
    param(
        [string]$path,
        [string]$packagename)

    if (test-path $path\$packagename){
            pushd $path
            write-host "deleting $packagename"
            start-process -wait sftmime.exe -argumentlist "delete package:$packagename /global"
            write-host "Re-Adding $packagename"
            start-process -wait sftmime.exe -argumentlist "add package:$packagename /manifest .\$packagename\$packagename`_manifest.xml /global"
            write-host "Loading $packagename"
            start-process -wait sftmime.exe -argumentlist "load package:$packagename"
            popd
          }#end path if
     Else {
        write-warning "package directory / path not found"}
}#end function
  1. Arthur
    July 25, 2012 at 1:17 pm

    Great script, but I want to delete it from a local computer that is having app problems with an app-v and refresh the app-v server. Any thoughts?

    • July 25, 2012 at 4:30 pm

      Hi Arthur,

      I’m afraid I dont have an App-V installation to hand.

      have you tried sfttray /refreshall after deleting the application? or sftmime refresh server:servername?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: