Skip to content

Instantly share code, notes, and snippets.

View JustinGrote's full-sized avatar

Justin Grote JustinGrote

View GitHub Profile
JustinGrote / Arcify.ps1
Last active April 24, 2024 16:16
Better Azure Arc Agent Onboarding Script
#Requires -Version 5.1 -RunAsAdministrator
using namespace System.IO
using namespace System.Net
#NOTE: The core code flow in is in the Main region at the bottom of the script.
This is a script that unifies the Azure Arc and AKS Edge Essentials installation process. You can use this script to connect a server to Azure Arc as well as AKS Edge Essentials.
JustinGrote / ScreenConnect.psm1
Last active February 28, 2024 07:50
ScreenConnect Client
#requires -version 7
using namespace Microsoft.PowerShell.Commands
using namespace System.Text
$ErrorActionPreference = 'Stop'
#Suppress useless IRM Verbose output
$PSDefaultParameterValues['Invoke-RestMethod:Verbose'] = $false
$PSDefaultParameterValues['Invoke-WebRequest:Verbose'] = $false
$DebugPreference = 'SilentlyContinue'
JustinGrote / PowerAltoPlus.psm1
Last active February 26, 2024 17:16
An extension of the PowerAlto module to enable running "ssh" commands via RPC-XML thru panorama to managed devices without having direct line of sight to the managed firewalls. A sample report dump of the Arp/Route/Interface/VPN is included
#requires -module PowerAlto, ImportExcel
$ErrorActionPreference = 'Stop'
if (-not $MacVendorCache) {
Write-Warning 'MacVendorCache not found, downloading from This is common on the first run.'
$SCRIPT:MacVendorCache = @{}
foreach ($entry in $(ConvertFrom-Csv (Invoke-RestMethod ''))) {
$MacVendorCache[$entry.'Mac Prefix'] = $entry.'Vendor Name'
JustinGrote / Get-OpenApiDefinition.ps1
Created February 15, 2024 02:40
Download multiple parts of an OpenAPI spec
using namespace System.Collections.Generic
function Get-OpenApiDefinition {
Fetches the OpenAPI definition from the specified URI and for every ref, downloads the relative file to the destination folder. Currently only works with relative refs
param (
#The source
JustinGrote / eyecancer.txt
Created January 31, 2024 05:36
Dumpling Week 2024 Data
var _pageData = "[[1,null,null,null,null,null,null,null,null,null,\"at\",\"AAX3J7BhCRC7IVYMba1r7wDXuj920s9Frw:1706679164531\",\"10080040042915956860\",1706679164532,\"0\",\"en\",false,[null,null,\"\",\"\",\"\",\"Justin Grote\",\"\",\"\\u003ds1600\"],\"\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",\"\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\\u0026ehbc\\u003d2E312F\",\"\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",\"\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",null,null,true,\"https:/
JustinGrote / ConvertTo-Markdown.ps1
Created January 27, 2024 00:25
Convert PowerShell Objects to Markdown Display by screen-scraping Format-Table
using namespace System.Collections.Generic
using namespace Microsoft.PowerShell.Commands.Internal.Format
#Inspired by:
Converts PowerShell Objects or Format-Table output to Markdown
Function ConvertTo-Markdown {
JustinGrote / Update-HelpFast.ps1
Last active March 9, 2024 14:37
Update Help More Quickly using ThreadJob
#Requires -module ThreadJob
#Filter modules to update by name, otherwise will update all modules
[string[]]$Name = @(),
[ValidateSet('AllUsers', 'CurrentUser')]
$Scope = 'CurrentUser',
$ThrottleLimit = 30
try {
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)) (
// </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 / EquatableAndHashSetDemo.ps1
Last active December 21, 2023 20:49
Equatable and HashSets Demo
using namespace System.Collections.Generic
class Pet {
hidden [int] GetHashCode() {
$uniqueString = $this.Name + $this.Type
return $uniqueString.GetHashCode()
JustinGrote / GetAllPSGalleryPackages.ps1
Last active May 8, 2024 04:45
Get All Packages from the PowerShell Gallery
using namespace System.Management.Automation
using namespace System.Collections.Generic
[List[Job2]]$jobs = @()
[List[Object]]$Result = @()
$baseUri = '$skip='
$maxPackages = 309000
for ($i = 0; $i -lt $maxPackages; $i += 100) {