Bewerken

Delen via


Get-AzAutomationVariable

Gets an Automation variable.

Syntax

Get-AzAutomationVariable
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzAutomationVariable
   [-Name] <String>
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzAutomationVariable cmdlet gets one or more Azure Automation variables. To get a specific variable, specify its name.

Examples

Example 1: Get a variable

$Variable = Get-AzAutomationVariable -AutomationAccountName "Contoso17" -Name "Variable06" -ResourceGroupName "ResourceGroup01"
$Value = $Variable.value

The first command gets an Automation variable named Variable06 in the account named Contoso17. The command stores that object in the $Variable variable. The second command uses standard dot notation to refer to the value property of $Variable. The command stores the value in the $value variable.

Parameters

-AutomationAccountName

Specifies the name of the Automation account that contains the variables that this cmdlet gets.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of a variable that this cmdlet gets.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specifies the resource group for which this cmdlet gets variables.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Outputs

Variable