The New-AzAutomationVariable 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.
The first command gets a virtual machine by using the Get-AzVM 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.
Parameters
-AutomationAccountName
Specifies the name of the Automation account in which to store the variable.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.