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 / Set-StandardMember.ps1
Created March 1, 2023 02:34 — forked from santisq/Set-StandardMember.ps1
sets PSStandardMember for all input objects
using namespace System.Management.Automation
function Set-StandardMember {
[CmdletBinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[object] $InputObject,
[parameter(Mandatory)]
[string[]] $DefaultProperties
#Import-Module "$PSScriptRoot\..\Module\WindowsPresentationFramework" -Force
. "$PSScriptRoot\WindowsPresentationFramework.ps1"
#Region ThreadSafe
# Bind Variables
[WindowsPresentationFrameworkThreadSafe()]
[PSObject] $Variable = "Herro World from Proxy Scope"
[WindowsPresentationFrameworkThreadSafe()]
$Sync = [hashtable]::Synchronized(@{})
#
# Originally from: "http://sbrickey.com/Tech/Blog/Post/Parsing_IIS_Logs_with_PowerShell"
#
# Define the location of log files and a temporary file
$LogFolder = "C:\inetpub\logs\LogFiles\W3SVC123"
$LogFiles = [System.IO.Directory]::GetFiles($LogFolder, "*.log")
$LogTemp = "C:\inetpub\logs\LogFiles\W3SVC123\AllLogs.tmp"
# Logs will store each line of the log files in an array
function Export-AzKeyVaultCertificate {
[CmdletBinding()]
param (
[parameter(Mandatory)]
[string]
$VaultName,
[Parameter(Mandatory)]
[string]
$CertName,
@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
@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) <jborean93@gmail.com>
# 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.