Skip to content

Instantly share code, notes, and snippets.

View sean-mcardle's full-sized avatar

Sean McArdle sean-mcardle

  • State of Oregon
View GitHub Profile
@sean-mcardle
sean-mcardle / ActivatePIMRest.ps1
Last active December 22, 2025 21:35
Script for activating PIM roles. Meant to be used within the Azure shell when the PIM portal acts up again. Copy pasta. It utilizes REST APIs for role eligibility and activation to avoid DLL conflicts in the Identity Governance cmdlets (some of us just want to do our jobs instead of fight with your dependencies Microsoft).
function Out-SelectorMenu {
param (
[Parameter(ValueFromPipeline=$true)]
$InputObject,
[Parameter(Position=0)]
$Title,
$Selector
)
begin {
$_items = @()
@sean-mcardle
sean-mcardle / CsvToMD.ps1
Created September 16, 2025 16:36
Script for converting a CSV file to markdown. Note: the CSV is loaded into memory, not streamed from disk. Probably not suitable for large files.
function CsvToMd {
param ($PathToCsv)
if (-not (Test-Path $PathToCsv)) {
throw [System.IO.FileNotFoundException]::new("Provided path doesn't resolve to a CSV file", $PathToCsv)
}
$records = import-csv $PathToCsv
$header = ($records | select -First 1).PSObject.Properties.Name
function Out-SelectorMenu {
param (
[Parameter(ValueFromPipeline=$true)]
$InputObject,
[Parameter(Position=0)]
$Title
)
begin {
$_items = @()
}
################################################################################
## Helper Functions ##
################################################################################
function DecodeJwt {
param ($encodedToken)