PnP PowerShell can be used to automate the deployment, publishing, installing, upgrading and retracting of 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 apps to modern sites using PnP PowerShell.

Adding and publishing apps to the app catalog:

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

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

Removing the app from the app catalog:

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

Getting the app from the app catalog:

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

Installing the app to site collection:

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

Upgrading the app:

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

Uninstalling the app from site collection:

To uninstall the app from your site.

In the above write-up, I have explained all the PnP PowerShell commands for all operations, such as – getting, adding, installing, upgrading, removing, and uninstalling SharePoint app on SharePoint modern sites programmatically.