Skip to content

Instantly share code, notes, and snippets.

@ypcode
Last active Sep 10, 2017
Embed
What would you like to do?
param (
[Parameter(Mandatory=$true)]
[string] $TargetWeb,
[Parameter(Mandatory=$true)]
[string] $TasksLibraryName,
[Parameter(Mandatory=$false)]
[string] $PageName = "Kanban Board",
[Parameter(Mandatory=$false)]
[string] $StatusFieldName="Status"
)
# Connect to the target SharePoint Website
Connect-PnPOnline $TargetWeb
# Fetch the tasks list for the specified name
$tasksList = Get-PnPList $TasksLibraryName
# Add the Client-side Page with the name specified
Add-PnPClientSidePage -Name $PageName
# Add the Kanban Board WebPart and configure its properties
Add-PnPClientSideWebPart -Page $PageName -Component KanbanBoard -WebPartProperties @{tasksListId=$tasksList.Id; statusFieldName="Status"}
# Publish the page when all config is done
Set-PnPClientSidePage -Identity $PageName -Publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment