Skip to content

Instantly share code, notes, and snippets.

View JustinGrote's full-sized avatar

Justin Grote JustinGrote

View GitHub Profile
@JustinGrote
JustinGrote / Update-HelpFast.ps1
Last active May 1, 2025 20:48
Update Help More Quickly using ThreadJob
#Requires -module ThreadJob
param(
#Filter modules to update by name, otherwise will update all modules
[string[]]$Name = @(),
[ValidateSet('AllUsers', 'CurrentUser')]
$Scope = 'CurrentUser',
$ThrottleLimit = 30
)
try {
@JustinGrote
JustinGrote / NinjaOne.cs
Created January 17, 2024 20:07
NinjaOne AutoGen Module using nswag
This file has been truncated, but you can view the full file.
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
#nullable enable
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
@JustinGrote
JustinGrote / EquatableAndHashSetDemo.ps1
Last active December 21, 2023 20:49
Equatable and HashSets Demo
using namespace System.Collections.Generic
class Pet {
[string]$Name
[string]$Type
hidden [int] GetHashCode() {
$uniqueString = $this.Name + $this.Type
return $uniqueString.GetHashCode()
}
@JustinGrote
JustinGrote / GetAllPSGalleryPackages.ps1
Last active August 19, 2024 19:17
Get All Packages from the PowerShell Gallery
using namespace System.Management.Automation
using namespace System.Collections.Generic
[List[Job2]]$jobs = @()
[List[Object]]$Result = @()
$baseUri = 'https://www.powershellgallery.com/api/v2/Packages?$skip='
$maxPackages = 309000
for ($i = 0; $i -lt $maxPackages; $i += 100) {
@JustinGrote
JustinGrote / snippet-schema.json
Created December 4, 2023 22:22
Snippet JSON Schema Attempt
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"any": {
"anyOf": [
{ "$ref": "#/definitions/tabstop" },
{ "$ref": "#/definitions/placeholder" },
{ "$ref": "#/definitions/choice" },
{ "$ref": "#/definitions/variable" },
@JustinGrote
JustinGrote / PodBeanTranscription.psm1
Last active May 2, 2024 00:50
Podbean Podcast Transcription to Storage Account
#requires -module Az.CognitiveServices
using namespace Microsoft.Azure.Commands.Management.CognitiveServices.Models
function Get-PodBeanPodcast ($Name = 'powershellpodcast') {
Invoke-RestMethod https://feed.podbean.com/$Name/feed.xml
}
#region Base
function Connect-AzSpeech {
[OutputType([AzSpeechContext])]
@JustinGrote
JustinGrote / paxwatch.ps1
Last active August 19, 2024 04:25
PAX Watcher Script
Write-Host -fore green '===PAX CHECKER==='
Write-Host -fore green '===This will open a browser to the ticket window if PAX goes on sale==='
$result = $null
do {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Host -fore gray "$(Get-Date): Checking ShowClix for PAX"
$paxEvents = (Invoke-RestMethod -Headers @{'Cache-Control' = 'max-age=0'} 'https://www.showclix.com/rest.api/Partner/48/events').psobject.properties.value |
Where-Object { $PSItem.event -match 'PAX' -and $PSItem.event -notmatch 'BYOC|Special|Media|Exhibitor' }
$result = $paxEvents |
Where-Object {
@JustinGrote
JustinGrote / settings.json
Last active June 13, 2025 16:46
Justin Grote's Visual Studio Code Settings
{
"[bicep]": {
"editor.defaultFormatter": "ms-azuretools.vscode-bicep",
"editor.suggest.showWords": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.wordBasedSuggestions": false,
"files.insertFinalNewline": true
},
"[csharp]": {
@JustinGrote
JustinGrote / MSBuild.xsd
Last active April 18, 2023 20:58
MSBuild XSD Schema for VSCode Validation including some missing options
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://schemas.microsoft.com/developer/msbuild/2003"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msb="http://schemas.microsoft.com/developer/msbuild/2003"
elementFormDefault="qualified">
<!-- =================== IMPORT COMMON SCHEMA =========================== -->
<xs:include schemaLocation="https://raw.githubusercontent.com/dotnet/msbuild/main/src/MSBuild/Microsoft.Build.xsd"/>
<!-- ========= ADD CUSTOM ITEMS, PROPERTIES, AND TASKS BELOW ======= -->
@JustinGrote
JustinGrote / pingometer.json
Created April 12, 2023 16:55
Scoop Package Manifest for PingoMeter
{
"version": "0.9.9",
"description": "A small portable program that show your ping in Windows system tray.",
"homepage": "https://github.com/EFLFE/PingoMeter",
"license": "MIT",
"url": "https://github.com/EFLFE/PingoMeter/releases/download/0.9.9/PingoMeter_r0.9.9.zip",
"hash": "065C609C9AE945F55AA9476195091BE0A8D8D112B8ABDAB9392CE400981C88E4",
"extract_dir": "PingoMeter",
"shortcuts": [
[