Reputation: 3746
I manually do these now. Is there a way to automate the above steps via PowerShell script?
Upvotes: 0
Views: 293
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