Skip to content

Instantly share code, notes, and snippets.

View Tsusai's full-sized avatar

Tsusai

View GitHub Profile
@Tsusai
Tsusai / pnpremove.ps1
Created January 7, 2026 16:59
PnP Driver Cleanup
$raw = pnputil /enum-drivers
# Split into chunks by blank lines
$chunks = ($raw -join "`n") -split "(\r?\n){2,}"
$drivers = foreach ($chunk in $chunks) {
$props = @{
PublishedName = ''
Provider = ''
Class = ''
@Tsusai
Tsusai / ProfileCleanup.ps1
Created May 16, 2024 13:19
Profile Cleanup Script
if ($PSVersionTable.PSVersion.Major -eq 7) {
Write-Output "Powershell 7 Detected. Please run using the Windows built in Powershell."
Write-Output "If debugging, press CTRL SHIFT P in VS Code to change session to Windows Powershell"
exit
}
### GLOBAL VAR ###
$HKLM = [UInt32] "0x80000002" # HKEY_LOCAL_MACHINE
$ProfileListKey = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
@Tsusai
Tsusai / snapraid-helper-implicit.ps1
Last active November 15, 2018 20:52
[UNTESTED] SnapRaid-Helper using older PS Mail code for Implicit SSL
###############################
# Snapraid Sync Helper Script #
###############################
# this is a helper script that keeps snapraid parity info in sync with
# your data. Here's how it works:
# 1) it first calls diff to figure out if the parity info is out of sync
# 2) if there are changed files (i.e. new, changed, moved or removed),
# it then checks how many files were removed.
# 3) if the deleted files exceed X (configurable), it triggers an
# alert email and stops. (in case of accidental deletions)