Skip to content

Instantly share code, notes, and snippets.

View potatoqualitee's full-sized avatar
big permz energy

Chrissy LeMaire potatoqualitee

big permz energy
View GitHub Profile
@potatoqualitee
potatoqualitee / action.yml
Last active August 27, 2022 01:15
Download file using Playwright in GitHub Actions
on: push
jobs:
download-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
@potatoqualitee
potatoqualitee / overview.ps1
Created August 26, 2022 09:08
dbatools presentation scripts
<#
Combo commands that are powerful and fun
1. Encrypting
2. Testing your backups
3. Disaster Recovery
#>
# Show SSMS
@potatoqualitee
potatoqualitee / Test-DarkColor.ps1
Last active August 26, 2022 04:14
Test-DarkColor
function Test-DarkColor {
<#
.SYNOPSIS
Tests an rgb or hex value to see if it's considered light or dark
.PARAMETER Color
The color to test in Hex or RGB
.NOTES
Thanks to:
$parms = @{
   Path        = "C:\windows\system32"
   Recurse     = $true
   ErrorAction = "SilentlyContinue"
}

Measure-Benchmark -RepeatCount 25 -Technique @{
    ForEachObject = { 
        Get-ChildItem @parms | ForEach-Object -Process {
@potatoqualitee
potatoqualitee / sys-summit-demo.ps1
Last active June 28, 2022 08:41
dbatools for systems engineers and accidental dbas
break
<#
01. Find instances
02. Connect to instances
03. Check backups
04. Check disk space
05. Perform backups
06. Check for corruption
07. Install maintenance scripts
08. Export all settings for DR
@potatoqualitee
potatoqualitee / Test-FileHash.ps1
Last active February 28, 2022 12:33
Simple file hash comparison tool written in PowerShell
function Test-FileHash {
<#
.Synopsis
This is a simple file hash comparison tool that writes to Windows Events when changes are detected
.Description
This is a simple file hash comparison tool that writes to Windows Events when changes are detected
.PARAMETER FilePath
The path to the file to hash and compare
@potatoqualitee
potatoqualitee / hugo.yml
Created February 20, 2022 20:12
github actions / hugo
name: github pages
on:
push:
branches:
- blog # Set a branch to deploy
pull_request:
jobs:
deploy:
@potatoqualitee
potatoqualitee / Convert-Pfx.ps1
Last active December 4, 2024 03:13
Convert-Pfx
function Convert-Pfx {
<#
.SYNOPSIS
Converts PFX to .cer and .key
.DESCRIPTION
Converts PFX to .cer and .key
Requires openssl
@potatoqualitee
potatoqualitee / ZInstall-KBUpdate.ps1
Last active September 29, 2023 23:06
Installing KB Updates on Remote System, 5 day dev journal
# THIS HASN'T BEEN ADDED TO THE KBUPDATE REPO YET BUT WILL BE WHEN I GET A MOMENT
function Install-KbPatch {
<#
.SYNOPSIS
Installs KBs on local and remote servers on Windows-based systems
.DESCRIPTION
Installs KBs on local and remote servers on Windows-based systems
PowerShell 5.1 must be installed and enabled on the target machine and the target machine must be Windows-based
@potatoqualitee
potatoqualitee / getguid.ps1
Created December 28, 2021 12:32
Get GUID / Product Id / Registration ID from Windows Update EXE Executable
# Install WIX toolset
Import-Module "C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.Compression.dll"
Import-Module "C:\Program Files (x86)\WiX Toolset v3.11\bin\\Microsoft.Deployment.Compression.Cab.dll"
$cab = New-Object Microsoft.Deployment.Compression.Cab.Cabinfo "$home\Downloads\file\dotnet-sdk-5.0.404-win-x64_a943fac999a30b3eb83580112b793d37de0c0700.exe"
$cab.UnpackFile("0","C:\temp\0.xml")
$a = [xml](Get-Content "C:\temp\0.xml")
$guid = [guid]$a.BurnManifest.Registration.Id