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'.