Skip to content

Instantly share code, notes, and snippets.

View BrianSidebotham's full-sized avatar

Brian Sidebotham BrianSidebotham

View GitHub Profile
@rajbos
rajbos / Get-JWTToken.ps1
Last active March 11, 2025 05:59
Load jwt token from GitHub App for authentication
# code to load the JWT token in PowerShell
# Call teh Get-JWTToken method with the App ID and the App Private Key (normal string from env var or file contents, make sure there is no extra line ending at the end of it!).
function Build-Payload {
Param (
[string] $app_id
)
$iat = [Math]::Floor([decimal](Get-Date(Get-Date) -UFormat %s))
$payload = @{
"iat" = [int]$iat # issues at = now