Update

For the latest version of this code please visit msgraph-sdk-powershell-examples.

Deprecated Content

Obtaining an Access Token for Microsoft Graph using the Device Code grant and PowerShell with the Invoke-RestMethod cmdlet.

PowerShell Code