Skip to content

Instantly share code, notes, and snippets.

View sassdawe's full-sized avatar
💭
Playing PowerShell

David Sass sassdawe

💭
Playing PowerShell
View GitHub Profile

Automated Patch Reference Guide

Overview

The installation and configuration of SharePoint 2013 Cumulative Updates, Service Packs and Security Updates are a time intensive and tedious process. In an effort to reduce the installation time, a series of PowerShell scripts was developed to reduce the effort required in patch installation and PSCONFIG execution. Each script described in this guide is independent from one another, allowing a SharePoint administrator to execute any number of scripts to aid with patch installation.

PowerShell Remoting Configuration

The majority of the scripts referenced in this document require PowerShell Remoting to be configured on each of the SharePoint servers in the farm. PowerShell Remoting allows a PowerShell script to execute commands on each of the SharePoint servers, without an administrator having to logon to the SharePoint server and manually execute a script. The following section outlines the steps necessary to configure PowerShell Remoting on the servers in

@sassdawe
sassdawe / Set-VSCodePolicies.ps1
Created June 9, 2026 12:13
Script to enforce VSCode policies by editing the registry
## source: https://github.com/microsoft/vscode/issues/242922#issuecomment-3928062264
# Create the VS Code policy registry key if it doesn't exist
if (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\VSCode")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\VSCode" -Force -EA SilentlyContinue
}
# Set AllowedExtensions policy - allows Microsoft extensions and approved third-party extensions
$allowedExtensions = @{
# Allow all extensions from trusted publishers

IRQL - Incident Response Query Language

A collection of Kusto (KQL) functions that unify security logs behind a consistent, analyst-friendly dialect. IRQL encapsulates query logic in repeatable chunks, hides cluster/database locations and join keys, and projects disparate source schemas into a single, predictable schema. In addition, it represents query logic as their semantic intent via function naming. These functions were created by Saar Ron, John Lambert, and Diana Damenova.

These functions were authored alongside the Lift to Graph functions (Lift_To_Graph, Graph_Render_View, Graph_Fold_By_Property) and are designed to compose with them. Many of the IRQL primitives have a tabular form and a graph-lifted form, so the same logic drives both relational hunts and visual graph investigations.

Why IRQL?

KQL is a phenomenal tool for analyzing large quantities of data, but queries can get verbose quickly:

@sassdawe
sassdawe / PSGet Publisher Checks.md
Created December 2, 2025 15:03 — forked from jborean93/PSGet Publisher Checks.md
Behaviour of signed PowerShell scripts

PSGet Code Signing

This is to try and document the behaviour around PowerShellGet/PSResourceGet code signing publisher behaviour.

Setup

The following code can be used to set up this scenario. This must be run as an administrator in Windows PowerShell.

Note: PowerShell uses implicit remoting for the New-SelfSignedCertificate which breaks the constains serialization. You must run this on Windows PowerShell.

@sassdawe
sassdawe / PSGet Publisher Checks.md
Created December 2, 2025 15:03 — forked from jborean93/PSGet Publisher Checks.md
Behaviour of signed PowerShell scripts

PSGet Code Signing

This is to try and document the behaviour around PowerShellGet/PSResourceGet code signing publisher behaviour.

Setup

The following code can be used to set up this scenario. This must be run as an administrator in Windows PowerShell.

Note: PowerShell uses implicit remoting for the New-SelfSignedCertificate which breaks the constains serialization. You must run this on Windows PowerShell.

@sassdawe
sassdawe / remember-kids.txt
Created November 3, 2025 17:11
the difference
Remember, kids, the only difference
between screwing around and science
is writing it down.
@sassdawe
sassdawe / xpat-edit-pwsh.ps1
Created May 21, 2025 07:59
get a terminal file editor for every system where you use PowerShell
install-Module psedit
set-alias edit show-pseditor
@sassdawe
sassdawe / ternary.ps1
Last active April 13, 2025 19:14
Ternary operator for Windows PowerShell v2 and beyond, maybe even for v1
<##################################################################################
#
# Script name: ternary.ps1
# source http://blogs.technet.com/b/heyscriptingguy/archive/2009/06/15/hey-scripting-guy-event-2-solutions-from-expert-commentators-beginner-and-advanced-the-long-jump.aspx
#
##################################################################################>
set-alias ?: Invoke-Ternary -Option AllScope -Description "PSCX filter alias"
filter Invoke-Ternary ([scriptblock]$decider, [scriptblock]$ifTrue, [scriptblock]$ifFalse) {
if (&$decider) {
@sassdawe
sassdawe / HashSet.ps1
Created May 8, 2024 12:45
HashSet is a hash-based collection that allows only distinct elements
<#
The basics: A HashSet is a collection that holds unique elements in no particular order (O(1) complexity
for adding, searching or removing). The HashSet<T> is a generic class in the System.Collections.Generic
namespace, ideal for managing large data sets and performing set operations.
Core aspects: The dotnet HashSet is a hash-based collection that allows only distinct elements.
It supports various operations such as Union, Intersection, Difference, and more.
More: https://www.bytehide.com/blog/hashset-csharp
#>
@sassdawe
sassdawe / OrderedDictionary.ps1
Last active May 10, 2024 05:07
System.Collections.Specialized.OrderedDictionary
# option 1
using namespace System.Collections.Specialized
$ordered = new-object OrderedDictionary
# option 2
$ordered = new-object System.Collections.Specialized.OrderedDictionary
# members
$ordered | get-member