Get-​Azure​Rm​Policy​Definition

Gets policy definitions.

Syntax

Get-AzureRmPolicyDefinition
   [-ApiVersion <String>]
   -Id <String>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-Pre]
   [<CommonParameters>]
Get-AzureRmPolicyDefinition
   [-ApiVersion <String>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   -Name <String>
   [-Pre]
   [<CommonParameters>]

Description

The Get-AzureRmPolicyDefinition cmdlet gets all the policy definitions or a specific policy definition identified by name or ID.

Examples

Example 1: Get all policy definition

PS C:\>Get-AzureRmPolicyDefinition

This command gets all the policy definitions.

Example 2: Get policy definition by name

PS C:\>Get-AzureRmPolicyDefinition -Name "VMPolicyDefinition"

This command gets the policy definition named VMPolicyDefinition.

Required Parameters

-Id

Specifies the fully qualified resource ID for the policy definition that this cmdlet gets.

Type:String
Aliases:ResourceId
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the policy definition that this cmdlet gets.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApiVersion

Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Pre

Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False