external help file | ms.assetid | online version | schema |
---|---|---|---|
Microsoft.Azure.Commands.ResourceManager.Automation.dll-Help.xml |
5AF6F70F-7137-48E2-96ED-2C509042F127 |
2.0.0 |
Creates an Automation variable.
New-AzureRmAutomationVariable [-Name] <String> -Encrypted <Boolean> [-Description <String>] [-Value <Object>]
[-ResourceGroupName] <String> [-AutomationAccountName] <String> [<CommonParameters>]
The New-AzureRmAutomationVariable cmdlet creates a variable in Azure Automation. To encrypt the variable, specify the Encrypted parameter. You cannot modify the encrypted state of a variable after creation.
PS C:\> New-AzureRmAutomationVariable -AutomationAccountName "Contoso17" -Name "StringVariable22" -Encrypted $False -Value "My String" -ResourceGroupName "ResourceGroup01"
This command creates a variable named StringVariable22 with a string value in the Automation account named Contoso17.
PS C:\> $VirtualMachine = Get-AzureVM -ServiceName "VirtualMachine" -Name "VirtualMachine03"
PS C:\> New-AzureRmAutomationVariable -AutomationAccountName "Contoso17" -Name "ComplexVariable01" -Encrypted $False -Value $VirtualMachine -ResourceGroupName "ResourceGroup01"
The first command gets a virtual machine by using the Get-AzureVM cmdlet. The command stores it in the $VirtualMachine variable.
The second command creates a variable named ComplexVariable01 in the Automation account named Contoso17. This command uses a complex object for its value, in this case, the virtual machine in $VirtualMachine.
Specifies the name of the Automation account in which to store the variable.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies a description for the variable.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies whether this cmdlet encrypts the value of the variable for storage.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies a name for the variable.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the resource group for which this cmdlet creates a variable.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies a value for the variable.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).