Get-AzAutomationVariable
Gets an Automation variable.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
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
PS C:\>$Variable = Get-AzAutomationVariable -AutomationAccountName "Contoso17" -Name "Variable06" -ResourceGroupName "ResourceGroup01"
PS C:\> $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
Specifies the name of the Automation account that contains the variables that this cmdlet gets.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of a variable that this cmdlet gets.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the resource group for which this cmdlet gets variables.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |