When I use a browser I use this endpoint to authorize:
https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id=<client_id>&response_type=code&redirect_uri=<redirect_uri>&scope=email+offline_access+openid+profile&state=&prompt=select_account
then I log in to my Microsoft account, and it redirects me to my application.
How I can log in to get a token from PowerShell? I need it for test automation. I found something like this (https://github.com/shawntabrizi/Microsoft-Authentication-with-PowerShell-and-MSAL/tree/master/Authorization%20Code%20Grant%20Flow) but I'm not sure if it is a good solution for my case.
Appreciate any help.
EDIT: