Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Paul Bullock pkbullock

🎯
Focusing
View GitHub Profile
@pkbullock
pkbullock / Update-WebUserLanguagePreference.ps1
Last active May 30, 2020
Change MUI Setting in SharePoint for User
View Update-WebUserLanguagePreference.ps1
Connect-PnPOnline https://<tenant>.sharepoint.com/sites/<site>
Get-PnPListItem -List "User Information List" -Id 7 # Me
# -OR- #
$userEmail = "paul.bullock@mytenant.co.uk"
$CamlQuery = @"
<View>
<Query>
<Where>
@pkbullock
pkbullock / Export-Mapping-File.ps1
Last active Apr 11, 2020
Example of exporting the mapping file
View Export-Mapping-File.ps1
$sp13Conn = Connect-PnPOnline http://portal2013/en -ReturnConnection
Export-PnPClientSidePageMapping `
-CustomPageLayoutMapping `
-PublishingPage "Our-New-IT-Suite-Is-Mint.aspx" `
-Folder "C:\temp\Blog" `
-Connection $sp13Conn
@pkbullock
pkbullock / PageLayoutMapping.xml
Last active Apr 11, 2020
Xml Fragment of Mapping File
View PageLayoutMapping.xml
<MetaData>
<Field Name="Title" TargetFieldName="" Functions="" />
<Field Name="IntranetKeywords" TargetFieldName="" Functions="" />
<Field Name="PublishingIsFurlPage" TargetFieldName="" Functions="" />
<Field Name="IntranetContentAuthor" TargetFieldName="" Functions="" />
<Field Name="IntranetContentPublishingDate" TargetFieldName="" Functions="" />
<!-- Managed Metadata field -->
<Field Name="IntranetContentCategory" TargetFieldName="IntranetContentCategoryMulti" Functions="" />
@pkbullock
pkbullock / Transform with Terms.ps1
Last active Apr 11, 2020
Term Store Transformation Example Command
View Transform with Terms.ps1
ConvertTo-PnPClientSidePage -Identity "Our-New-IT-Suite-Is-Mint.aspx" -PublishingPage `
-TargetConnection $spOnlineConn -Connection $sp13Conn `
-Overwrite `
-PageLayoutMapping C:\temp\Demo\onprem-news-mapping.xml `
-TermMappingFile C:\temp\Demo\termmapping.csv `
-LogType Console
@pkbullock
pkbullock / Fragment.xml
Created Apr 1, 2020
PnP Provisioning English Regional Settings - Xml Fragment
View Fragment.xml
<pnp:RegionalSettings AdjustHijriDays="0" AlternateCalendarType="None" CalendarType="Gregorian" Collation="25" FirstDayOfWeek="Monday" FirstWeekOfYear="2" LocaleId="2057" ShowWeeks="false" Time24="true" TimeZone="2" WorkDayEndHour="5:00PM" WorkDays="62" WorkDayStartHour="8:00AM" />
@pkbullock
pkbullock / Set-AppPage.ps1
Created Jan 7, 2020
Learning Pathways set app page
View Set-AppPage.ps1
Connect-PnPOnline https://tenant.sharepoint.com/sites/LearningPortal/
Set-PnPClientSidePage -Identity Custom-Pack-Content -LayoutType SingleWebPartAppPage
@pkbullock
pkbullock / playlists.json
Created Jan 7, 2020
Demo playlists.json for the Learning Pathways
View playlists.json
[
{
"Id": "a8cbac83-f7e8-45ff-a4a6-6b04f31a5745",
"Title": "Modern SharePoint Editing Experience",
"Image": "images/playlists/share_and_coauthor.png",
"LevelId": "a5522c84-14c5-4b36-b28e-9c6364837c98",
"AudienceId": "71ec9903-1498-49e2-8514-428e35617b18",
"TechnologyId": "a97cb2db-55fb-43ec-8ded-67909ce1c61f",
"SubjectId": "",
"Source": "Microsoft",
@pkbullock
pkbullock / guid-gen.ps1
Created Jan 7, 2020
Quick GUID generation and copy to clipboard
View guid-gen.ps1
[System.Guid]::NewGuid().Guid | clip
@pkbullock
pkbullock / demo-fragment-metadata.json
Created Jan 7, 2020
Demo fragment metadata.json file for Learning Pathways
View demo-fragment-metadata.json
"Categories": [
{
"Id": "618da7fa-0ed2-4653-9dfd-271c3bbe3a44",
"Name": "Products",
"Image": "",
"TechnologyId": "",
"SubjectId": "",
"Source": "Microsoft",
"SubCategories": [
@pkbullock
pkbullock / demo-empty-playlists.json
Last active Jan 7, 2020
Demo empty playlists.json file for Learning Pathways
View demo-empty-playlists.json
[
{
"Id": "08365272-6868-4482-9384-b720d0121533",
"Title": "",
"Image": "images/playlists/",
"LevelId": "",
"AudienceId": "",
"TechnologyId": "",
"SubjectId": "",
"Source": "SOC",