Skip to content

Instantly share code, notes, and snippets.

@BobGerman
Created September 22, 2017 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BobGerman/8e3f56ae99bd7dab260d7f0cdb9c147e to your computer and use it in GitHub Desktop.
Save BobGerman/8e3f56ae99bd7dab260d7f0cdb9c147e to your computer and use it in GitHub Desktop.
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