Skip to content

Instantly share code, notes, and snippets.

View pkbullock's full-sized avatar
🎯
Focusing

Paul Bullock pkbullock

🎯
Focusing
View GitHub Profile
@pkbullock
pkbullock / gist:cd9113bf0064dbb4af6f4b5f36d3f7e6
Last active September 14, 2018 05:48
spfx-cuttheclutter-usersettings.json
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
//Exclude these spfx locations
"**/.vscode": true,
"**/node_modules": true,
@pkbullock
pkbullock / List-GitRepos.ps1
Created April 10, 2018 06:33
Get List of Git Repo Urls
$startingDir = Get-Location
Get-ChildItem | ?{ $_.PSIsContainer } | Select-Object FullName |
Foreach-Object {
Set-Location $_.FullName
git config --get remote.origin.url
}
Set-Location $startingDir
@pkbullock
pkbullock / List-InstalledPrograms.ps1
Created April 10, 2018 06:37
List Installed Programs (Windows)
# Run command as administrator
wmic product list
@pkbullock
pkbullock / New-Guid.ps1
Created April 10, 2018 06:38
Useful for quickly getting new GUID for SP Field development
[System.Guid]::NewGuid().Guid | clip
@pkbullock
pkbullock / Update-GitRepos.ps1
Created August 6, 2018 16:04
Update Git Repos - Bulk Git Pull
$startingPoint = Get-Location
# Set the Repos here
$dirList = dir -Directory
$dirList | Foreach-Object {
Write-Host 'Updating... ' $_
# Go to sub folder
@pkbullock
pkbullock / Remove-DeleteOption.ps1
Last active September 16, 2018 20:42
Removes the delete option on a document library or list in SharePoint using PnP PowerShell
# See full script at
# https://github.com/CaPa-Creative-Ltd/SharePoint-Recipes/blob/master/Recipes/Document-Management/Remove-DeleteOption.ps1
Connect-PnPOnline -Url "https://<tenant>.sharepoint.com"
$list = Get-PnPList -Identity "<list or library>"
$list.AllowDeletion = $false
$list.Update()
Invoke-PnPQuery
@pkbullock
pkbullock / Set-LowerSiteMembersPermission.ps1
Last active September 16, 2018 20:41
Lowers the standard permissions to contributors
# See full script at:
# https://github.com/CaPa-Creative-Ltd/SharePoint-Recipes/blob/master/Recipes/Document-Management/Set-LowerSiteMembersPermissions.ps1
Connect-PnPOnline -Url "https://<tenant>.sharepoint.com"
$membersGroup = Get-PnPGroup -AssociatedMemberGroup
Set-PnPGroupPermissions -Identity $membersGroup -RemoveRole "Edit" -AddRole "Contribute"
Write-Host "Done! :-)" -ForegroundColor Green
@pkbullock
pkbullock / Highlighted-News-Row.json
Last active September 27, 2018 15:10
Highlight News Items in a Site Pages Modern Library - Row
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$PromotedState] > 0, 'sp-field-severity--good', '')"
}
@pkbullock
pkbullock / Highlighted-Column.json
Created September 27, 2018 15:11
Highlight News Items in a Site Pages Modern Library - Column
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
@pkbullock
pkbullock / Get-SupportedLanguages.ps1
Last active October 17, 2018 15:57
Get Supported Language Codes
# Simple script to get the installed languages in SharePoint Online
Connect-PnPOnline -Url "https://<mytenant>.sharepoint.com"
(Get-PnPWeb -Includes RegionalSettings.InstalledLanguages).RegionalSettings.InstalledLanguages