I've used the PnP Site provisioning method to create a sub web with unique permissions. However, when applying an XML site template with the default visitors, members, and owners security group defined in the template sections, the groups are not assigned. So what's the best method using PnP PowerShell to create sub webs with unique permissions and standard groups?
Here's my PowerShell:
#Connect to Site Collection
$me = Get-Credential
Connect-PNPOnline -url https://mytenet.sharepoint.com/sites/MySiteCollection -credential $me
#Create sub web with unique permissions
New-PnPWeb -Title "ProjectB Web" -Url ProjectB -Description "Information about ProjectB" -BreakInheritance -InheritNavigation -Template "STS#0"
#Apply template with groups. Templates applies OK, but groups are not defined
Apply-PnPProvisioningTemplate -Path C:\ProjectSiteTemplate.xml -Web projectB