SharePoint App Operations Using PnP PowerShell

PnP PowerShell can be used to automate the deployment, publishing, installing, upgrading and retracting apps in SharePoint online as well as SharePoint on-premises.

In this blog, we will look at steps to get, add, install, deploy, update, remove and uninstall SharePoint app to Modern Site using PnP PowerShell.

Adding and publishing app to the app catalog:

Adding app (.sppkg file, .app file) to the tenant scoped app catalog.

–> Add-PnPApp -Path <App Path> -Scope Tenant

Once added, need to continue with publishing app using below command.

–> Publish-PnPApp -Identity <App Id>

PnP powershell

Removing the app from the app catalog:

To remove the specified app from the tenant scoped app catalog.

–> Remove-PnPApp -Identity <App Id> -Scope Tenant

Remove-PnPApp

Getting the app from the app catalog:

Get a list of apps in the tenant scoped app catalog.

–>  Get-PnPApp -Scope Tenant

Get-PnPApp

Installing the app to site collection:

After the app is added to the app catalog and published, you can install the app to a specific site.

–>  Install-PnPApp -Identity <App Id> -Scope Tenant

Install-PnPApp

Upgrading the app:

The command used to update an already installed app if a new version is available in the tenant app catalog.

–> Update-PnPApp -Identity <App Id> -Scope Tenant

Update-PnPApp

Uninstalling the app from site collection:

To uninstall the app from your site.

–> Uninstall-PnPApp -Identity <app id> -Scope Tenant

Uninstall-PnPApp

In above I have explained all operations getting, adding, installing, upgrading, removing and uninstalling SharePoint app on SharePoint modern site programmatically, using PnP PowerShell commands.

This solution is brought to you by our SharePoint professionals…..

 

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *