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.
--> Add-PnPApp -Path <App Path> -Scope Tenant
Once added, we need to continue with publishing the app using the below command.
--> Publish-PnPApp -Identity <App Id>
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
Getting the app from the app catalog:
Get a list of apps in the tenant scoped app catalog.
--> Get-PnPApp -Scope Tenant
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.
--> Install-PnPApp -Identity <App Id> -Scope Tenant
Upgrading the app:
The command is 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
Uninstalling the app from site collection:
To uninstall the app from your site.
--> Uninstall-PnPApp -Identity <app id> -Scope Tenant
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.

Shubham BishtPosted Aug 6, 2025, 6:21 AM
Hi, I am looking for some help with PowerShell script to add the "app to all sites" using PowerShell. After uploading the app with script "Added to all sites" column in the SharePoint Admin Center shows "No" for a deployed app's manifest.Is there any PowerShell or PnP PowerShell command to set "Added to all sites" to "Yes" automatically for an app in the catalog
PRIYA CHAUDHARYPosted Sep 27, 2021, 5:45 AM
I want to do the checkIn with comment for an App(.sppkg) in siteCollection app catalog using sharepoint PNP Powershell same as you defined above. but I could not find any parameter to do so. can you please suggest me that how can I do this as this checkIn comment, I can do manually in appcatalog but how can I do this using PnPPowershell command. Please reply as soon as possible. Thanks in advance,