Skip to content

Instantly share code, notes, and snippets.

View JustinGrote's full-sized avatar

Justin Grote JustinGrote

View GitHub Profile
@JustinGrote
JustinGrote / CodeTunnel.ps1
Last active April 20, 2024 05:30
Visual Studio Code Tunnel bootstrap via PowerShell (works in Azure Cloud Shell)
#require -version 5.1
#Usage: iwr https://tinyurl.com/VSCodeServer | iex
#Parameterized usage: & ([ScriptBlock]::Create((iwr https://tinyurl.com/VSCodeServer))) -Your -Options
param(
#Path to install the vscode binary to. This defaults to a folder in your Local AppData path. Must be writable by your current user without sudo
[ValidateNotNullOrEmpty()]
[string]$InstallPath = $(Join-Path -Path ([System.Environment]::GetFolderPath('LocalApplicationData')) -ChildPath 'vscode-cli'),
#Installation architecture. This is normally autodetected.
$Arch,
$OS,
@JustinGrote
JustinGrote / AksEdgeEssentialsOnboard.ps1
Last active April 18, 2024 22:35
Better Azure Arc Agent Onboarding Script
<#
QuickStart script for setting up Azure for AKS Edge Essentials and deploying the same on the Windows device
#>
param(
[Parameter(Mandatory)]
[String] $AideUserConfigFilePath,
[Parameter(Mandatory)]
[string] $AksEdgeConfigFilePath,
[string] $Tag
@JustinGrote
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,\"justingrote@gmail.com\",\"https://lh4.googleusercontent.com/-R4mL1JYgKEs/AAAAAAAAAAI/AAAAAAAAAAA/-74UcaDbnzk/s32-c/photo.jpg\",\"https://plus.google.com/100005784601014694175/about\",\"Justin Grote\",\"https://lh4.googleusercontent.com/-R4mL1JYgKEs/AAAAAAAAAAI/AAAAAAAAAAA/-74UcaDbnzk/s64-c/photo.jpg\",\"https://lh3.googleusercontent.com/c5dqxl-2uHZ82ah9p7yxrVF1ZssrJNSV_15Nu0TUZwzCWqmtoLxCUJgEzLGtxsrJ6-v6R6rKU_-FYm881TTiMCJ_\\u003ds1600\"],\"https://www.google.com/maps/d/viewer?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",\"https://www.google.com/maps/d/embed?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\\u0026ehbc\\u003d2E312F\",\"https://www.google.com/maps/d/edit?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",\"https://www.google.com/maps/d/thumbnail?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",null,null,true,\"https:/
@JustinGrote
JustinGrote / Trace-AICommand.ps1
Last active April 9, 2024 22:25
Report the results and performance of any scriptblock to Azure Application Insights
#requires -version 7
#You can load this script with $(iwr https://tinyurl.com/TraceAICommand | iex)
using namespace Microsoft.ApplicationInsights
using namespace Microsoft.ApplicationInsights.Extensibility
using namespace Microsoft.ApplicationInsights.DataContracts
using namespace System.Management.Automation
using namespace System.Collections.Generic
using namespace System.Net
#Reference: https://docs.microsoft.com/en-us/azure/azure-monitor/app/console
@JustinGrote
JustinGrote / PodBeanTranscription.psm1
Last active April 9, 2024 21:13
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 / Get-MgServicePrincipalPermission.ps1
Last active April 3, 2024 21:56
Get a list of application and delegated permissions for a service principal, similar to what the Azure Portal shows
#requires -version 7 -module Microsoft.Graph.Applications
using namespace Microsoft.Graph.PowerShell.Models
using namespace System.Collections.Generic
enum MicrosoftGraphServicePrincipalType {
Application
Delegated
}
class MgServicePrincipalPermission {
@JustinGrote
JustinGrote / Commvault.ps1
Last active March 11, 2024 21:24
Commvault REST API Commands I will make into a Module Someday
<#
Quickstart
------------------
Get-Help Connect-CVServer -detailed
Get-Help Invoke-CVCommand -detailed
Connect-CVServer mycommvaultserver -force -verbose
Invoke-CVCommand 'Client'
Invoke-CVCommand 'Client/136'
#>
@JustinGrote
JustinGrote / Update-HelpFast.ps1
Last active March 9, 2024 14:37
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 / 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: https://gist.github.com/aaroncalderon/09a2833831c0f3a3bb57fe2224963942
<#
.Synopsis
Converts PowerShell Objects or Format-Table output to Markdown
#>
Function ConvertTo-Markdown {
[CmdletBinding()]
@JustinGrote
JustinGrote / Test-AzDOPipeline.ps1
Last active March 6, 2024 12:19
Test Azure Devops Pipeline YAML
function Test-AzDOPipeline {
<#
.SYNOPSIS
Tests an Azure Devops Pipeline YAML configuration
.DESCRIPTION
This can be used to validate an Azure Devops pipeline configuration within a particular pipeline project.
#>
param (
#Your Azure Devops Organization Name