Skip to content

Instantly share code, notes, and snippets.

View kevinblumenfeld's full-sized avatar
🎯
Focusing

Kevin Blumenfeld kevinblumenfeld

🎯
Focusing
View GitHub Profile
@kevinblumenfeld
kevinblumenfeld / Jwt-CreateToken.ps1
Created September 26, 2020 03:06 — forked from dindoliboon/Jwt-CreateToken.ps1
System.IdentityModel.Tokens.Jwt with PowerShell to create JWT using RS256
<#
System.IdentityModel.Tokens.Jwt with PowerShell to create JWT using RS256.
http://blog.d-apps.com/2013/08/powershell-and-json-web-token-handler.html
Tested using:
Windows 10.0.18362.628
PowerShell 7.0.0
Windows PowerShell 5.1.18362.628
NuGet 5.4.0.6315
System.IdentityModel.Tokens.Jwt 5.6.0
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"copyOnSelect": false,
"copyFormatting": false,
"profiles": {
"defaults": {
},
"list": [
@kevinblumenfeld
kevinblumenfeld / New-EXOPSSession.ps1
Created August 21, 2020 05:41 — forked from jborean93/New-EXOPSSession.ps1
Cross platform function that can connect to Exchange Online using modern auth
# Copyright: (c) 2020, Jordan Borean (@jborean93) <[email protected]>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
#Requires -Module MSAL.PS
Function New-EXOPSSession {
<#
.SYNOPSIS
Will open a PSSession to Exchange Online.
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Hashtable</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">SourceApp</S>
<Obj N="Value" RefId="1">
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Hashtable</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">SourceApp</S>
<Obj N="Value" RefId="1">
Install-Module @('PSWinDocumentation', 'PSWinDocumentation.AD', 'PSWriteWord', 'PSWriteExcel')
Import-Module PSWinDocumentation
Import-Module PSWinDocumentation.AD
# Import-Module DbaTools # (if you require SQL export)
# Those should automatically load
#Import-Module PSWriteWord
#Import-Module PSWriteExcel
#Import-Module ActiveDirectory
$Document = [ordered]@{
Configuration = [ordered] @{
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Hashtable</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">SourceApp</S>
<Obj N="Value" RefId="1">
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Hashtable</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">SourceApp</S>
<Obj N="Value" RefId="1">
{
"changeNumber": 91,
"cloud": "Public",
"values": [
{
"name": "AzureActiveDirectory",
"id": "AzureActiveDirectory",
"properties": {
"changeNumber": 4,
"region": "",