Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Paul Bullock pkbullock

🎯
Focusing
View GitHub Profile
@pkbullock
pkbullock / gist:cd9113bf0064dbb4af6f4b5f36d3f7e6
Last active Sep 14, 2018
spfx-cuttheclutter-usersettings.json
View gist:cd9113bf0064dbb4af6f4b5f36d3f7e6
"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 Apr 10, 2018
Get List of Git Repo Urls
View List-GitRepos.ps1
$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 Apr 10, 2018
List Installed Programs (Windows)
View List-InstalledPrograms.ps1
# Run command as administrator
wmic product list
@pkbullock
pkbullock / New-Guid.ps1
Created Apr 10, 2018
Useful for quickly getting new GUID for SP Field development
View New-Guid.ps1
[System.Guid]::NewGuid().Guid | clip
@pkbullock
pkbullock / Update-GitRepos.ps1
Created Aug 6, 2018
Update Git Repos - Bulk Git Pull
View Update-GitRepos.ps1
$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 Sep 16, 2018
Removes the delete option on a document library or list in SharePoint using PnP PowerShell
View Remove-DeleteOption.ps1
# 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 Sep 16, 2018
Lowers the standard permissions to contributors
View Set-LowerSiteMembersPermission.ps1
# 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 Sep 27, 2018
Highlight News Items in a Site Pages Modern Library - Row
View Highlighted-News-Row.json
{
"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 Sep 27, 2018
Highlight News Items in a Site Pages Modern Library - Column
View Highlighted-Column.json
{
"$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 Oct 17, 2018
Get Supported Language Codes
View Get-SupportedLanguages.ps1
# Simple script to get the installed languages in SharePoint Online
Connect-PnPOnline -Url "https://<mytenant>.sharepoint.com"
(Get-PnPWeb -Includes RegionalSettings.InstalledLanguages).RegionalSettings.InstalledLanguages