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.

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,328 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Manu Philip 17,671 Reputation points MVP
    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