Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Provisioning a modern team site with PnP PowerShell
Connect-PnPMicrosoftGraph -Scopes "Group.ReadWrite.All","User.Read.All"
$group = New-PnPUnifiedGroup -DisplayName "xxx" -Description "xxx" -MailNickname "xxx"
-Members "user@tenant.onmicrosoft.com" -IsPrivate
Connect-PnPOnline $group.SiteUrl
# Here you would normally apply a Provisioning Template to create lists, libraries, web parts etc.
# based on a "template" site. Instead, I just want to show placing a couple web parts in a
# 2-column section to show how that works:
Add-PnPClientSideSection -Page "Home.aspx" -SectionTemplate TwoColumnRight
Add-PnPClientSideWebPart -DefaultWebPartType "NewsFeed" -Page "Home.aspx" -Section 1 -Column 1
Add-PnPClientSideWebPart -Component "SiteClassification" -Section 1 -Column 2 -Page $p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment