0

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?

user989988
  • 3,006
  • 7
  • 44
  • 91

1 Answers1

0

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
Carl Zhao
  • 8,543
  • 2
  • 11
  • 19