Skip to content

Instantly share code, notes, and snippets.

View bcameron1231's full-sized avatar

Beau Cameron bcameron1231

View GitHub Profile
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"tileProps": {
"hideSelection": true,
"hideListHeader": true,
"formatter": {
"elmType": "div",
"style": {
"display": "flex",
"flex-wrap": "wrap",
<Field DisplayName="ChoiceField" FillInChoice="FALSE" Format="Dropdown" Name="ChoiceField" Title="ChoiceField" Type="MultiChoice" ID="{bfc3a23a-832b-4c4a-b9e3-254e3cb7917a}" SourceID="{fd155260-83fa-440e-85c7-ff9026d1b2ff}" StaticName="ChoiceField" ColName="ntext6" RowOrdinal="0" CustomFormatter="{
"$schema": "",
"debugMode": true,
"elmType": "div",
"children": [
{
"elmType": "div",
"style": {
"display": "block",
"width": "100%","color":"blue"
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "CustomFormatter JSON",
"description": "CustomFormatter renderer for SharePoint lists",
"definitions": {
"customAction": {
"type": "object",
"additionalProperties": false,
"title": "Action object",
"description": "Action object for a custom action button",
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "CustomFormatter JSON",
"description": "CustomFormatter renderer for SharePoint lists",
"definitions": {
"customAction": {
"type": "object",
"additionalProperties": false,
"title": "Action object",
"description": "Action object for a custom action button",
{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "JSON Schema for Site Scripts",
"description": "A SharePoint Site Script definition",
"definitions": {
"SPListSubactions": {
"setTitle": {
"type": "object",
"title": "Set the title",
"description": "Set the title of the list",
$sitedesign = Get-SPOSiteDesign | where {$_.Title -eq "Advanced Design"}
[System.Collections.ArrayList]$existingsitescripts = $sitedesign.SiteScriptIds | select -ExpandProperty Guid
$existingsitescripts.Add($sitescript.Id)
Set-SPOSiteDesign -Identity $sitedesign.Id -SiteScripts $existingsitescripts
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
$admin = 'youraccount@tenant.OnMicrosoft.Com'
$password = Read-Host 'Enter Password' -AsSecureString
$context = New-Object Microsoft.SharePoint.Client.ClientContext("https://tenant.sharepoint.com/sites/testpnp");
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($admin , $password)
$context.Credentials = $credentials
using (var ctx = new OfficeDevPnP.Core.AuthenticationManager().GetAppOnlyAuthenticatedContext(newSiteUrl, clientId, clientSecret))
{
var pages = ctx.Web.Lists.GetByTitle("Site Pages");
ctx.Load(pages);
//get template page
var templatePage = pages.RootFolder.GetFile("Project-Home.aspx").ListItemAllFields;
ctx.Load(templatePage);
ctx.ExecuteQuery();
$site = Get-SPSite http://siteColl
$site | Get-SPWeb -Limit ALL | ForEach-Object {
foreach ($list in $_.lists)
{
$list["Title"] = "NewTitle"
$list.Update()
}
}
$site.Dispose()