Skip to content

Instantly share code, notes, and snippets.

View ryanspletzer's full-sized avatar

Ryan Spletzer ryanspletzer

View GitHub Profile
@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
@davidteren
davidteren / nerd_fonts.md
Last active May 10, 2025 11:30
Install Nerd Fonts via Homebrew [updated & fixed]
@lrvick
lrvick / github-troll.md
Last active April 1, 2025 08:14
Trolling Github's DMCA repo with their own security flaws.
@Francisco-Gamino
Francisco-Gamino / Az.Functions.md
Last active September 23, 2024 13:21
Az.Functions - Managing Azure Functions via PowerShell.
# Managing Azure Functions via PowerShell Cmdlets
# Prerequisites:
# - PowerShell Core 6 or greater --> https://github.com/PowerShell/PowerShell/releases
# - Core Tools --> https://github.com/Azure/azure-functions-core-tools#installing
# - Az.Functions preview module --> https://www.powershellgallery.com/packages/Az.Functions/0.0.2-preview

# Install Azure Functions PowerShell core module
Install-Module -Name Az.Functions -AllowPrerelease
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active May 12, 2025 10:36
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

{
"builders": [
{
"type": "amazon-ebs",
"region": "us-west-2",
"instance_type": "t2.micro",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "CIS Microsoft Windows Server 2016 Benchmark v1.1.0.*Level 1*",
#region UX config
Import-Module posh-git
if (Get-Module PSReadLine) {
Import-Module oh-my-posh
$ThemeSettings.MyThemesLocation = "~/.config/powershell/oh-my-posh/Themes"
if (Get-Theme | Where-Object Name -eq Sorin-NL) {
Set-Theme Sorin-NL
@fireflycons
fireflycons / Install-PowerShellService.ps1
Created November 23, 2018 08:19
Script to install a PowerShell script as a Windows Service using NSSM
<#
.SYNOPSIS
Installs PowerShell scripts as Windows Services.
.DESCRIPTION
Installs or removes PowerShell script services.
When installing, any additional command line arguments besides the mandatory ones are supplied as arguments to the script you are installing, and credentials for the service will be prompted for.
The service will be installed for automatic start, however the initial state is 'Stopped'
This tool will additionally pass the switch -Service to the target script which it should implement to know it is running as a service.
@ryanspletzer
ryanspletzer / dotnetlayout.md
Created October 29, 2018 17:43 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@IISResetMe
IISResetMe / ConvertTo-Object.ps1
Last active July 25, 2023 23:12
Quick and dirty regex-based text-to-object parsing using named expressions groups and $Matches
function ConvertTo-Object {
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[AllowEmptyString()]
[string[]]$InputString,
[Parameter(Mandatory=$true,ValueFromRemainingArguments=$true)]
[string[]]$Pattern
)