Skip to content

Instantly share code, notes, and snippets.

View PalmEmanuel's full-sized avatar

Emanuel Palm PalmEmanuel

View GitHub Profile
@JustinGrote
JustinGrote / Start-MSIEmulator.ps1
Last active December 23, 2025 05:14
A Managed Identity Emulator for testing Managed Identities locally. Returns a token from your currently logged in Azure PowerShell context
#requires -Module Az.Accounts
$verbosePreference = 'continue'
function ConvertFrom-JWTtoken {
<#
.NOTES
Lovingly borrowed from: https://www.michev.info/blog/post/2140/decode-jwt-access-and-id-tokens-via-powershell
#>
[cmdletbinding()]
param([Parameter(Mandatory = $true)][string]$token)
@JustinGrote
JustinGrote / Get-MgServicePrincipalPermission.ps1
Last active November 6, 2024 10:21
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 {
@axelheer
axelheer / Resolver.cs
Last active April 10, 2024 10:48
Custom *Assembly load context* as *Module assembly initializer* using *Assembly dependency resolver* to load all the things! Solves dependency conflicts of multiple PowerShell modules and honors .deps.json files...
using System;
using System.Linq;
using System.Management.Automation;
using System.Reflection;
using System.Runtime.Loader;
namespace MyModule
{
public class Resolver : AssemblyLoadContext, IModuleAssemblyInitializer, IModuleAssemblyCleanup
{