Skip to content

Parameter

SYNOPSIS

Declares a policy parameter.

SYNTAX

Parameter [-Name] <Object> [[-Options] <Object>] [-Type <String>] [-AllowedValues <Object[]>] [-Default <Object>] [-DisplayName <String>] [-Description <String>] [-JsonName <String>] [-Metadata <IDict
ionary>] [<CommonParameters>]

DESCRIPTION

One-line form: Parameter Effect -AllowedValues Audit, Deny, Disabled -Default Deny Hashtable form: Parameter Locations @{ Type = 'Array'; Metadata = @{ strongType = 'location' } } Parameter @{ Name = 'Locations'; Type = 'Array' }

The hashtable form takes the same options as keys, one per line if you like (ADR-0021). When -Type is omitted it is inferred from -Default or -AllowedValues.

USED IN

Policy, Initiative

EXAMPLES

Example 1

Parameter Effect -AllowedValues Audit, Deny, Disabled -Default Audit

Example 2

Parameter AllowedValues @{
    Type        = 'Array'
    Default     = 'Public', 'Private', 'Confidential', 'Restricted'
    DisplayName = 'Allowed values'
    Description = 'Allowed classifications'
}

PARAMETERS

-Name

Parameter name, or a hashtable with the keys Name, Type, AllowedValues, Default, DisplayName, Description, JsonName and Metadata.

Type: Object
Required: true
Position: 1
Accept pipeline input: false

-Options

The options as a hashtable, after the name: the same keys as above, without Name.

Type: Object
Required: false
Position: 2
Accept pipeline input: false

-Type

String, Array, Object, Boolean, Integer, Float or DateTime. Inferred from -Default or -AllowedValues when left out.

Type: String
Required: false
Position: named
Accept pipeline input: false

-AllowedValues

The values an assignment may choose from.

Type: Object[]
Required: false
Position: named
Accept pipeline input: false

-Default

The value used when an assignment doesn't set one.

Type: Object
Required: false
Position: named
Accept pipeline input: false

-DisplayName

The name shown in the portal. Defaults to the parameter name, split into words.

Type: String
Required: false
Position: named
Accept pipeline input: false

-Description

The description shown in the portal.

Type: String
Required: false
Position: named
Accept pipeline input: false

-JsonName

The name in the emitted JSON. Defaults to the parameter name with a lower-case first letter, e.g. allowedLocations for AllowedLocations.

Type: String
Required: false
Position: named
Accept pipeline input: false

-Metadata

Other parameter metadata, such as @{ strongType = 'location' }.

Type: IDictionary
Required: false
Position: named
Accept pipeline input: false