Skip to content

Instantly share code, notes, and snippets.

@jpcranford
jpcranford / wingetAsSystemViaRMM.ps1
Created July 9, 2025 14:20
A simple Powershell script to install an app using winget when running as System. Compatible with RMMs, tested on Syncro.
# EDIT THESE TO CHANGE THE APP TO INSTALL
$wingetAppId = "7zip.7zip" # This script will only install an exact match, so double-check.
$customInstallerArgs = "" # These will vary by app. Check the EXE/MSI documentation.
$ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe"
if ($ResolveWingetPath){
$WingetPath = $ResolveWingetPath[-1].Path
}
$Wingetpath = Split-Path -Path $WingetPath -Parent
@jpcranford
jpcranford / Roman Numerals.applescript
Last active September 26, 2021 00:02
Some quick AppleScript handlers to convert between roman numerals and integers.
romanToInt("mcdxcii")
--> 1492
intToRoman(1492)
--> "MCDXCII"
on romanToInt(numeral)
set numeral to my TextHandlers's changeCaseOfText(numeral, "uppercase")
set n to 0
try
@jpcranford
jpcranford / avrae cheatsheet.md
Last active July 22, 2025 20:47
A handy cheatsheet and tutorial for using the Discord bot Avrae. https://avrae.io

Roll some dice: !roll 1d12+3 adv


A linked character sheet is needed to run commands in the following table.

Action Avrae command
Ability check !check perception
Initiative roll !check init
@jpcranford
jpcranford / Open scripture reference.applescript
Last active August 30, 2021 20:17
An AppleScript for opening scriptures on ChurchOfJesusChrist.org. Easily added to the right-click menu across macOS: open Automator, create new Quick Action, set input to text from any app, and add the "Run AppleScript" action with the code below.
on run {input}
--set testStringList to {"Gen. 4:7", " Eccl. 3:1,7 ", "Luke 16:1–2 (1-12)", "Moses 4:15", "D&C 121:43", "Isaiah 45:19", "Alma 38:12", " Doctrine and Covenants 122:7", "Matt. 25:21 (14-30)", "2 Kgs. 20:1 (1–6)"}
--set input to item 10 of testStringList -- LINE FOR TESTING
-- Clean up input:
set input to trimText(input, space, "both")
set input to findAndReplaceInText(input, "–", "-")
set input to findAndReplaceInText(input, "—", "-")
set book to regexSearch(input, "(.+) .+:.+")
log result