I am trying to execute Get-AzureADServicePrincipal in a azure powershell task in ADO. I need to get service principal for me to then connect to get ServicePrincipalId and ServicePrincipalkey. As part of this I am trying the below, as an inline script
Install-Module -Name AzureAD Get-AzureADServicePrincipal
But this keeps failing as,
WARNING: User declined to install module (AzureAD)
Please could some one help? Thanks
Install-Module is prompting for user input. Specify the -Force flag.
If you are using host agent. Better to install a module only for the current user
This example downloads and installs the newest version of a module, only for the current user. Also add -Force
Install-Module -Name PowerShellGet -Scope CurrentUser -Force
Then you need to call the Connect-AzureAD cmdlet before calling any other cmdlets.
Finally Get-AzureADServicePrincipal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With