1

Using Azure DevOps pipeline with PowerShell script assigning the policy with NonComplianceMessage. Then I got the below error.

2021-08-02T07:21:05.7714484Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\cadf1c03-4c62-4b29-94bb-75675246caf1.ps1'"
2021-08-02T07:21:09.4647913Z ##[command]Import-Module -Name C:\Modules\az_3.1.0\Az.Accounts\2.2.5\Az.Accounts.psd1 -Global
2021-08-02T07:21:10.9130504Z ##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
2021-08-02T07:21:11.8858020Z ##[command]Clear-AzContext -Scope Process
2021-08-02T07:21:12.5106334Z ##[command]Connect-AzAccount -ServicePrincipal -Tenant *** -Credential System.Management.Automation.PSCredential -Environment AzureCloud @processScope
2021-08-02T07:21:14.7099241Z ##[command] Set-AzContext -SubscriptionId d6d47b2f-91eb-4003-bd93-aeba442cd113 -TenantId ***
2021-08-02T07:21:22.1462218Z ##[error]**A parameter cannot be found that matches parameter name 'NonComplianceMessage'.**
2021-08-02T07:21:22.3074409Z ##[error]PowerShell exited with code '1'.
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Kotha Ramesh Babu
  • 355
  • 1
  • 4
  • 10

1 Answers1

-1

In the release pipeline changed the Azure PowerShell Version to Latest Installed Version instead of Specified Other Version (3.1.0)

Azure DevOps Pipeline Task - Azure PowerShell Version Update

Kotha Ramesh Babu
  • 355
  • 1
  • 4
  • 10