I'm on sp2013 Enterprise on-prem and using an on-prem hosted app.

The .app file is deployed to an appcatalog.

I update the hosted app version by dropping the app file into the appcatalog. This makes the new version available on all sites (200+) but doeds not upgrade the instance on each site.

This requires me to go to site contents and manually upgrade each instance. How can I do this with powershell?

The import-SPAppPAckage requires a -Path parameter and appears to be used for those apps that are housed in the site collection. I tried the code below but since Path is a required parameter it clued me in that this may not be for use with appcatalog hosted apps.

$web = "https://myweb.wes.com"
$appName = "MyHostedApp"
$AssetID = "some guid"

$AppInstanceOnSite = Get-SPAppInstance -web $web | Where-Object {$_.Title -eq $appName};
$NewAppFile = Import-SPAppPackage -AssetID $AssetID -Path $path -site $web -source CorporateCatalog;
Update-SPAppInstance -identity $AppInstanceOnSite -App $NewAppFile;

Any help is appreciated.


  • Can you upload the .app file to some document library and use that as the path? – spDevAdmin Jul 21 '20 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.