Skip to content

Get-AzPolicyDefinition and Get-AzPolicySetDefinition what is Name value #17828

Answered by wsmelton
wsmelton asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, figured out I have to dig into each one for the Properties and then filter on DisplayName.

$mgmtGroup = 'mg-something'
$policySetName = 'My policy'
Get-AzPolicySetDefinition -ManagementGroupName $mgmtGroup -Custom | Where {$_.Properties.DisplayName -eq $policySetName }

Was hoping it would be easier than this because this takes a good bit of time to run just to pull one definition.

It

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wsmelton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant