SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following script to update my SharePoint app with the latest version but it always fails with the error:

Install-SPApp : An instance of this App already exists at the specified

when the app is already installed on the site. For SPSolutions I can wait on while ($solution.JobExists) is there an equivalent for SharePoint Apps (.app)?

#check if app already exists
$instances = Get-SPAppInstance -Web $siteCol
$instance = $instances | where {$_.Title -eq $file.BaseName}
if($instance -ne $null){
    Write-Host "Uninstalling app " $file.BaseName

    Uninstall-SPAppInstance -Identity $instance -Confirm:$false
    #need to wait here

Write-Host "Installing app " $file.BaseName
#install the app
$spapp = Import-SPAppPackage  –Path $file.FullName  –Site $siteCol  -Source ObjectModel -Confirm:$false
$newInstance = Install-SPApp –Web $siteCol -Identity $spapp 
share|improve this question
up vote 1 down vote accepted

I was able to find the answer in this MSDN blog

There is an Update-SPAppInstance method to be used when an app is already installed and then you can wait on the status of the AppInstance

while (($appInstance.Status -eq ([Microsoft.SharePoint.Administration.SPAppInstanceStatus]::Upgrading))
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.