Edit

Get-AzPolicySetDefinition

Gets policy set definitions.

Syntax

NameParameterSet (Default)

Get-AzPolicySetDefinition
    [-Name <String>]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ManagementGroupNameParameterSet

Get-AzPolicySetDefinition
    -ManagementGroupName <String>
    [-Name <String>]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SubscriptionIdParameterSet

Get-AzPolicySetDefinition
    -SubscriptionId <Guid>
    [-Name <String>]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

IdParameterSet

Get-AzPolicySetDefinition
    -Id <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

BuiltinFilterParameterSet

Get-AzPolicySetDefinition
    [-ManagementGroupName <String>]
    [-SubscriptionId <Guid>]
    [-Builtin]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

CustomFilterParameterSet

Get-AzPolicySetDefinition
    [-ManagementGroupName <String>]
    [-SubscriptionId <Guid>]
    [-Custom]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzPolicySetDefinition cmdlet gets a collection of policy set definitions or a specific policy set definition identified by name or ID.

Examples

Example 1: Get all policy set definitions

PS C:\> Get-AzPolicySetDefinition

This command gets all the policy set definitions.

Example 2: Get policy set definition from current subscription by name

PS C:\> Get-AzPolicySetDefinition -Name 'VMPolicySetDefinition'

This command gets the policy set definition named VMPolicySetDefinition from the current default subscription.

Example 3: Get policy set definition from subscription by name

PS C:\> Get-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -subscriptionId 'aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e'

This command gets the policy definition named VMPolicySetDefinition from the subscription with ID aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e.

Example 4: Get all custom policy set definitions from management group

PS C:\> Get-AzPolicySetDefinition -ManagementGroupName 'Dept42' -Custom

This command gets all custom policy set definitions from the management group named Dept42.

Parameters

-ApiVersion

When set, indicates the version of the resource provider API to use. If not specified, the API version is automatically determined as the latest available.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Builtin

Limits list of results to only built-in policy set definitions.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

BuiltinFilterParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Custom

Limits list of results to only custom policy set definitions.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CustomFilterParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

The fully qualified policy set definition Id, including the subscription. e.g. /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ResourceId

Parameter sets

IdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ManagementGroupName

The name of the management group of the policy set definition(s) to get.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ManagementGroupNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

The policy set definition name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NameParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
ManagementGroupNameParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
SubscriptionIdParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Pre

When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubscriptionId

The subscription ID of the policy set definition(s) to get.

Parameter properties

Type:

Nullable<T>[Guid]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SubscriptionIdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Nullable<T>

Outputs

PSObject