-
I want to filter the impacted resources from Azure advisor recommendations through the PowerShell script. Requesting the count alone do not need any other information |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@Mo5zzz, I am not sure about your goal but the following code that may help you. It returns the list of KeyVaults that have a recommendation:
Note: the |
Beta Was this translation helpful? Give feedback.
@Mo5zzz, I am not sure about your goal but the following code that may help you. It returns the list of KeyVaults that have a recommendation:
Get-AzAdvisorRecommendation | Where-object { $_.ImpactedField -eq "Microsoft.KeyVault/vaults" } | ForEach-Object { Get-AzResource -ResourceType $_.ImpactedField -Name $_.ImpactedValue } | Sort-Object -Property Name -Unique
Note: the
Sort-Object
command deduplicate entries in the output in the case a resource has more than one recommendation.