I am trying to get a token from Microsoft.Graph using Powershell. I am using the following:
$clientId = <clientid>
$scopes = "https://graph.microsoft.com/.default"
$tenantId = <tenantid>
$token = Get-MsalToken -ClientId $clientId -TenantId $tenantId -Scopes $scopes
$accessToken = $token.AccessToken
But when i run this i get an error :
The term 'Get-MsalToken' is not recognized as the name of a cmdlet, function
Any ideas on how i can make this work or Get a token any other way ?
I would assume you need to install the MSAL.PS module to use
Get-MsalToken