Skip to content
{{ message }}

Instantly share code, notes, and snippets.

# Yannick Plenevaux ypcode

Created Sep 18, 2017
View app-perm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

Last active Sep 18, 2017
View apply-provtemplate.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Connect-PnPOnline https://yourtenant.sharepoint.com/sites/yoursite $path = ".\The\Path\to\your\template.xml" Apply-PnPProvisioningTemplate -Path$path
Last active Sep 16, 2017
View webhook-template.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

Created Sep 16, 2017
View add-webhook-subscription.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 import pnp from "pnp"; pnp.sp.web.lists.getByTitle("testwebhook") .subscriptions .add("https://your-functions.azurewebsites.net/api/sample-webhook", "2017-12-01T00:00:00+00:00") .then(r => console.log("Webhook added")) .catch(r => console.log(r));
Last active Sep 16, 2017
View Add-WebhookSubscription.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Connect-PnPOnline https://yourtenant.sharepoint.com/sites/yoursite # "testwebhook" is the name of our target list Add-PnPWebhookSubscription -List testwebhook -NotificationUrl https://your-functions.azurewebsites.net/api/sample-webhook # The command above outputs the following # Id : 080e41c2-3c30-4c4d-8d1c-fa22249aedc0 # ClientState : # ExpirationDateTime : 12-Mar-18 22:00:00 # NotificationUrl : https://your-functions.azurewebsites.net/api/sample-webhook # Resource : 6efa3b51-f514-4b88-9117-3d158e3f8fe2
Created Sep 11, 2017
View Associate-SPFxFieldCustomizer.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 ############################################################ # Set here the URL of your site $targetWebUrl = "https://yourtenant.sharepoint.com/sites/yoursite" # Set the name of the custom action here (do not really matter in this case but allows to identify it)$customAction = "ImportantMarker" # Set here the Id of your extension. You can find it in the manifest in your SPFx solution $componentId = [GUID]"42887c3b-0b7c-4fc4-8510-1107c73495c9" # Set here the Id or name of the list$listNameOrId = "MOTD" # Set here the internal name of the field to bind the extension to
Created Sep 11, 2017
View Associate-SPFxApplicationCustomizer.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 ############################################################ # Set here the URL of your site $targetWebUrl = "https://yourtenant.sharepoint.com/sites/yoursite" # Set the name of the custom action here (do not really matter in this case but allows to identify it)$customAction = "MotdBanner" # Set here the Id of your extension. You can find it in the manifest in your SPFx solution $componentId = "42887c3b-0b7c-4fc4-8510-1107c73495c9" ############################################################ Connect-PnPOnline$targetWebUrl Add-PnPCustomAction -Name $customAction -Title "MOTD" -Location "ClientSideExtension.ApplicationCustomizer" -ClientSideComponentId$componentId -ClientSideComponentProperties "{}"
Last active Sep 11, 2017
View Associate-SPFxListViewCommandSet.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # This script allows to associate a SPFx ListViewCommandSet extension to a list type (100) ###################################################################### # Due to some inconsistency in accepted Cmdlet arguments # We need to work around it by updating manually the RegistrationId and RegistrationType values # The ClientSideComponentProperties is required even if the extension don't need any property ###################################################################### # Target web URL $targetWebUrl = "https://yourtenant.sharepoint.com/sites/yoursite" # Set the name of your custom action here$customActionName = "MARK_AS_IMPORTANT"
Last active Sep 10, 2017
View Install-Kanban.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 param ( [Parameter(Mandatory=$true)] [string]$TargetWeb, [Parameter(Mandatory=$true)] [string]$TasksLibraryName, [Parameter(Mandatory=$false)] [string]$PageName = "Kanban Board", [Parameter(Mandatory=$false)] [string]$StatusFieldName="Status" )
Last active Sep 10, 2017
View provision-modern-page03.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Connect-PnPOnline https://contoso.sharepoint.com/sites/dev -Credentials contoso $page = Add-PnPClientSidePage -Name "Hello World" Add-PnPClientSidePageSection -Page$page -SectionTemplate TwoColumn Add-PnPClientSideText -Page $page -Section 1 -Column 1 -Text "Hello" Add-PnPClientSideText -Page$page -Section 1 -Column 2 -Text "World!" Add-PnPClientSidePageSection -Page $page -SectionTemplate OneColumn Add-PnPClientSideWebPart -Page$page -Section 2 -Column 1 -DefaultWebPartType BingMap