Skip to content

Instantly share code, notes, and snippets.

@garrytrinder
Last active November 5, 2019 23:46
Show Gist options
  • Save garrytrinder/0e606d2c3e48ddc4bf36b502ac884cff to your computer and use it in GitHub Desktop.
Save garrytrinder/0e606d2c3e48ddc4bf36b502ac884cff to your computer and use it in GitHub Desktop.
Calling the Microsoft Graph from PowerShell Core using Office 365 CLI
pwsh -NoLogo
o365 login
$token = o365 accesstoken get -r https://graph.microsoft.com --new
$request = Invoke-WebRequest -Uri https://graph.microsoft.com/v1.0/me -Headers @{"Authorization"="Bearer $token"}
$request.Content | ConvertFrom-Json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment