Skip to content

Instantly share code, notes, and snippets.

View joegasper's full-sized avatar

Joe Gasper joegasper

View GitHub Profile
@joegasper
joegasper / GPU-P-Partitioning.ps1
Last active March 30, 2025 11:37
GPU-P Partitioning Script
# Name of Hyper-V VM
$vm = "MyVMName"
# Total VRAM of physical GPU (GPU-P)
$TotalGPUpVram = 6Gb
# Percent of physical GPU resources to allocate to virtual GPU in the VM
[int]$GPUpAllocationPercent = 25
# Calculate the high memory mapped IO value based on total GPU-P VRAM
@joegasper
joegasper / Get-PHPVersion.ps1
Created February 4, 2023 18:04
Given a path, determine installed version of PHP
function Get-PHPVersion {
<#
.SYNOPSIS
Given a path, determine installed version of PHP.
.DESCRIPTION
The provided path will be searched for php.exe files and return the version of found PHP executables.
.PARAMETER Path
Path to search
.EXAMPLE
Get-PHPVersions -Path E:\PHP
@joegasper
joegasper / Get-TeamsReactionImages.ps1
Created February 2, 2023 16:07
Download reaction images for Microsoft Teams plug-in for Stream Deck
### Download reaction images for Microsoft Teams plug-in for Stream Deck
$csv = @"
"URL","FileName"
"https://github.com/microsoft/fluentui-emoji/blob/main/assets/Raised%20hand/Default/3D/raised_hand_3d_default.png","RaiseHand.png"
"https://github.com/microsoft/fluentui-emoji/blob/main/assets/Thumbs%20up/Default/3D/thumbs_up_3d_default.png","Like.png"
"https://github.com/microsoft/fluentui-emoji/blob/main/assets/Red%20heart/3D/red_heart_3d.png","Love.png"
"https://github.com/microsoft/fluentui-emoji/blob/main/assets/Clapping%20hands/Default/3D/clapping_hands_3d_default.png","Applause.png"
"https://github.com/microsoft/fluentui-emoji/blob/main/assets/Face%20with%20open%20mouth/3D/face_with_open_mouth_3d.png","Wow.png"
"https://github.com/microsoft/fluentui-emoji/blob/main/assets/Grinning%20squinting%20face/3D/grinning_squinting_face_3d.png","Laugh.png"
"@
@joegasper
joegasper / wp-cli-install-on-windows.md
Created January 21, 2023 05:59
WordPress WP-CLI Installation on Windows

WordPress WP-CLI Installation on Windows

Prerequisites: Chocolatey, PHP, Composer

Use an elevated PowerShell console

Install chocolatey

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
@joegasper
joegasper / winget-update-manifest.md
Last active November 13, 2023 01:51
winget - Update Existing Package Manifest
# Convert-ADName.ps1
# Written by Bill Stewart (bstewart@iname.com)
# PowerShell wrapper script for the NameTranslate COM object.
#requires -version 2
<#
.SYNOPSIS
Translates Active Directory names between various formats.
@joegasper
joegasper / export-team-membership-roster.js
Last active November 21, 2024 19:45 — forked from guillaumemeyer/export-team-membership-roster.js
Exports the owners and members of a Microsoft Teams team as a CSV file
// ****************************************************************************************************************************
// Abstract:
// This script is just a quick trick to export the owners and members of a team as a CSV file without administrator permissions.
// The following properties are exported: Display name, Title, Location, Role, Tags, UPN(email)
//
// Usage:
// 1. Open the team in your web browser: https://teams.microsoft.com
// 2. Select "Manage team" from its menu.
// 3. Select the "Members" tab.
// 4. Expand the "Owners" and "Members and guests" sections.
@joegasper
joegasper / windows_hardening.cmd
Created November 27, 2022 03:17 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@joegasper
joegasper / Get internet headers.OUTLOOK.yaml
Last active November 27, 2023 19:28
Gets internet headers on a message in Read mode.
name: Get internet headers
description: Gets internet headers on a message in Read mode.
host: OUTLOOK
api_set: {}
script:
content: |
$("#run").click(run);
function run() {
Office.context.mailbox.item.getAllInternetHeadersAsync(function(asyncResult) {
@joegasper
joegasper / New-DicePassPhrase7.ps1
Created September 13, 2021 21:51
Generate a password/passphrase based on a dice password list - only PowerShell Core/7 - added support for parallel foreach
<#
.SYNOPSIS
Returns a passphrase
.DESCRIPTION
Returns a passphrase based on a dice password list.
.EXAMPLE
New-DicePassPhrase
miles welt eta pall 41st