I'm fairly new to SharePoint scripting and after much searching I'm reaching out to see if someone can help me with the commands needed to complete this task.
I'm have a SharePoint Online site that contains a document library with broken inheritance. The document library has had some custom SP groups added to it. What I'm trying to do now is figure out how to add an AD group (synced to Azure) to one of the custom SP groups on the document library.
I've made it as far as being able to add the AD group to the document library as its own permission but I cannot figure out how to add the AD group INTO the SP group rather than directly to the document library.
I'm using this code to connect to SP Online and set the AD group as a permission the the document library.
Connect-PnPOnline -Url 'https://<domain>.sharepoint.com/sites/<site>' -Interactive
Set-PnPListPermission -User 'c:0t.c|tenant|<azure_ad_group_id>' -Identity '/<library_name>' -AddRole 'Contribute'
The document library already has SP groups 'Custom Group 1', 'Custom Group 2'. How do I add the AD group to those SP groups?
If this is possible with the normal SharePoint Online PowerShell module I'd prefer to use that, but I'm ok with PnP if that's the only option

