Skip to content

Add new examples #20361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Resources/Resources/help/Get-AzPolicyAssignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ Get-AzPolicyAssignment -Scope '/providers/Microsoft.Management/managementgroups/
The first command specifies the ID of the management group to query.
The second command gets all of the policy assignments that are assigned to the management group with ID 'myManagementGroup'.

### Example 4: Get the scope, policy set definition identifier, and display name of all policy assignments formatted as a list

```powershell
Get-AzPolicyAssignment | Select-Object -ExpandProperty properties | Select-Object -Property Scope, PolicyDefinitionID, DisplayName | Format-List
```

This command is useful when you need to find the reader-friendly **DisplayName** property of an Azure
Policy assignment.

## PARAMETERS

### -ApiVersion
Expand Down
13 changes: 11 additions & 2 deletions src/Resources/Resources/help/Get-AzPolicyDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,19 @@ This command gets all built-in policy definitions from the subscription with ID

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

This command gets all policy definitions in category "Virtual Machine".
This command gets all policy definitions in the category **Tags**.

### Example 6: Get the display name, description, policy type, and metadata of all policy definitions formatted as a list

```powershell
Get-AzPolicyDefinition | Select-Object -ExpandProperty properties | Select-Object -Property DisplayName, Description, PolicyType, Metadata | Format-List
```

This command is useful when you need to find the reader-friendly **DisplayName** property of an Azure
Policy definition. You can parse the **Metadata** property to discover the policy definition's version number and category assignment.

## PARAMETERS

Expand Down