title: Connect-AzAccount : The term 'Connect-AzAccount' is not recognized as the name of a cmdlet, function, script file, or operable program
body: <p>I am trying to execute the following PowerShell script in Azure DevOps pipeline by using PowerShell task with inline mode.</p>
  <blockquote>
  </blockquote>
  <pre><code>$clientId= &quot;xxxxxxxxx&quot;
  $clientSecret= &quot;xxxxxxx&quot;
  $subscriptionId= &quot;xxxxxxxx&quot;
  $tenantId= &quot;xxxxxxxxxxxxx&quot;
  # sign in
  Write-Host &quot;Logging in...&quot;;
  $SecurePassword = $clientSecret | ConvertTo-SecureString -AsPlainText -Force
  $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $clientId, $SecurePassword
  Connect-AzAccount -ServicePrincipal -Credential $cred-Tenant $tenantId 
  # set azure context with  subscriptionId
  Set-AzContext -SubscriptionId $subscriptionId
  # select subscription
  Write-Host &quot;Selecting subscription '$subscriptionId'&quot;;
  Select-AzSubscription -SubscriptionId $subscriptionId;
  </code></pre>
  <p>But I am getting the following error:</p>
  <p><strong>Connect-AzAccount : The term 'Connect-AzAccount' is not recognized as the name of a cmdlet, function, script file, or
  operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
  again.</strong></p>