Azure – get-policy state not returning correct display name instead returning guid
' subscriptionId = 'abc' $nonCompliantPolicies = Get-AzPolicyState -SubscriptionId $subscriptionId # Define a custom object for each non-compliant resource $customObjects = $nonCompliantPolicies | ForEach-Object { [PSCustomObject]@{ PolicyName = $_.PolicyDefinitionName ComplianceState = $_.ComplianceState ResourceType = $_.ResourceType ResourceGroup = $_.ResourceGroup SubscriptionId = $_.…