Skip to content

Commit d126c2e

Browse files
Add new examples (#20361)
* Add new examples * Implement Mike's feedback
1 parent 123683c commit d126c2e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/Resources/Resources/help/Get-AzPolicyAssignment.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ Get-AzPolicyAssignment -Scope '/providers/Microsoft.Management/managementgroups/
6868
The first command specifies the ID of the management group to query.
6969
The second command gets all of the policy assignments that are assigned to the management group with ID 'myManagementGroup'.
7070

71+
### Example 4: Get the scope, policy set definition identifier, and display name of all policy assignments formatted as a list
72+
73+
```powershell
74+
Get-AzPolicyAssignment | Select-Object -ExpandProperty properties | Select-Object -Property Scope, PolicyDefinitionID, DisplayName | Format-List
75+
```
76+
77+
This command is useful when you need to find the reader-friendly **DisplayName** property of an Azure
78+
Policy assignment.
79+
7180
## PARAMETERS
7281

7382
### -ApiVersion

src/Resources/Resources/help/Get-AzPolicyDefinition.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,19 @@ This command gets all built-in policy definitions from the subscription with ID
8484

8585
### Example 5: Get policy definitions from a given category
8686
```powershell
87-
Get-AzPolicyDefinition | Where-Object {$_.Properties.metadata.category -eq "Virtual Machine"}
87+
Get-AzPolicyDefinition | Where-Object {$_.Properties.metadata.category -eq 'Tags'}
8888
```
8989

90-
This command gets all policy definitions in category "Virtual Machine".
90+
This command gets all policy definitions in the category **Tags**.
91+
92+
### Example 6: Get the display name, description, policy type, and metadata of all policy definitions formatted as a list
93+
94+
```powershell
95+
Get-AzPolicyDefinition | Select-Object -ExpandProperty properties | Select-Object -Property DisplayName, Description, PolicyType, Metadata | Format-List
96+
```
97+
98+
This command is useful when you need to find the reader-friendly **DisplayName** property of an Azure
99+
Policy definition. You can parse the **Metadata** property to discover the policy definition's version number and category assignment.
91100

92101
## PARAMETERS
93102

0 commit comments

Comments
 (0)