Skip to content
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

Add an example for New-AzureRmPolicyDefinition that uses -Metadata #7829

Merged
merged 4 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Add an example for New-AzureRmPolicyDefinition that uses -Metadata

## Version 6.7.1
* Fix for https://github.com/Azure/azure-powershell/issues/7402
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ PS C:\> New-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -ManagementGroupN
This command creates a policy definition named VMPolicyDefinition in management group Dept42.
The command specifies the policy as a string in valid JSON format.

### Example 4: Create a policy definition inline with metadata
```
PS C:\> New-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -Metadata '{"Category":"Virtual Machine"}' -Policy '{"if":{"source":"action","equals":"Microsoft.Compute/virtualMachines/write"},"then":{"effect":"deny"}}'
```

This command creates a policy definition named VMPolicyDefinition with metadata indicating its category is "Virtual Machine".
mentat9 marked this conversation as resolved.
Show resolved Hide resolved
The command specifies the policy as a string in valid JSON format.

## PARAMETERS

### -ApiVersion
Expand Down