Skip to content

Instantly share code, notes, and snippets.

@lgp1985
Created May 6, 2025 19:45
Show Gist options
  • Save lgp1985/6814281d1c5c974bb496dad748fb66cd to your computer and use it in GitHub Desktop.
Save lgp1985/6814281d1c5c974bb496dad748fb66cd to your computer and use it in GitHub Desktop.
Quickly pass token to an Azure Microsoft Graph call with PowerShell
$azToken = az account get-access-token --resource https://graph.microsoft.com | ConvertFrom-Json
Invoke-WebRequest -Headers @{Authorization="$($azToken.tokenType) $($azToken.accessToken)"} https://graph.microsoft.com/v1.0/users/me
@lgp1985
Copy link
Author

lgp1985 commented May 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment