Question:
I have a PowerShell script which uses Connect-AzureAD and also Login-AzureRmAccount.
Even though both use the same credentials, I get asked to enter them twice. Is there any way to only prompt the user once and use the same credentials for both cmdlets?
Answer:
This finally worked for me
1 2 3 4 |
$cred = Get-Credential Login-AzureRmAccount -Credential $cred Connect-AzureAD -Credential $cred |
it does not display the neat Microsoft login screen but works for my scenarios