user989988
user989988

Reputation: 3746

How to add SharePoint App to Site using PnP Powershell script

enter image description here

enter image description here

I manually do these now. Is there a way to automate the above steps via PowerShell script?

Upvotes: 0

Views: 293

Answers (1)

Carl Zhao
Carl Zhao

Reputation: 9549

You need site owner permissions to be able to add apps to SharePoint Online Site.

Refer to my PnP Powershell script:

#Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/Legal"
$AppName = "Modern Script Editor web part by Puzzlepart"
 
#Connect to SharePoint Online App Catalog site
Connect-PnPOnline -Url $SiteURL -UseWebLogin
 
#Get the App from App Catalog
$App = Get-PnPApp -Scope Tenant | Where {$_.Title -eq $AppName}
 
#Install App to the Site
Install-PnPApp -Identity $App.Id

Upvotes: 0

Related Questions