Thursday 9 March 2017

Install and Uninstall SharePoint 2013 Apps using PowerShell.


This post will discuss how to install and uninstall the Apps in SharePoint 2013 On-Premise. I will create another post which will cover SharePoint Online.

So lets get started :)

Installing of Apps in SharePoint 2013


First thing we need to do is to import the app package file to our site collection.

Powershell to import it.


$App = Import-SPAppPackage -Path "C:\Rahul\App.app" -Site "http://Sharepoint2013" –Source ObjectModel

Source: can be Marketplace or CorporateCatalog, DeveloperSite, ObjectModel etc.
 
Now, we will install the app in site
 
Install-SPApp -Web http://Sharepoint2013/site -Identity $App

So Powershell script to install will be like:

$App = Import-SPAppPackage -Path "C:\Rahul\App.app" -Site "http://Sharepoint2013" –Source ObjectModel
Install-SPApp -Web http://Sharepoint2013/site -Identity $App
 

Uninstalling of Apps in SharePoint 2013 


For Uninstalling any app first we need to app from the site and after that we can uninstall it.

So Powershell script to uninstall will be like: 

$installapp = Get-SPAppInstance -web http://Sharepoint2013/site | Where-Object { $_.Title -eq "App" }
Uninstall-SPAppInstance -Identity $installapp 

Hope it helps:)

Happy SharePointing :)






 


 


No comments:

Post a Comment