Getting error in azure devops release

Anonymous
2024-07-12T17:12:37.0966667+00:00

Below is the error:

Error: The term 'Update-AzVmssInstances' is not recognized as a name of a cmdlet, function, script file, or executable program throws in Azure ppwershell of Azure devops pipeline.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Manu Philip 20,206 Reputation points MVP Volunteer Moderator
    2024-07-13T09:14:29.5733333+00:00

    Hi Priya,You can try setting up the un-recognized module manually, before running your PS scripts. Following lines of code can be added at the beginning of the script to overcome the issue. It also, uninstalls any AzureRm modules runs by default

    - task: PowerShell@2
            displayName: 'Update Az.Compute Module'
            inputs:
              targetType: 'inline'
              script: |
               Get-PackageProvider -Name NuGet -ForceBootstrap
               Install-Module -Name Az.Compute -Verbose -Force -AllowClobber
               Uninstall-AzureRm -Verbose
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.