Get-AutomationVariable Vs Get-AzureRmAutomationVariable

Hi,

I finally started working on PowerShell and so thought that documenting my learnings here would be useful. So in this post, we will see the difference between the 2 cmdlets Get-AzureRmAutomationVariable and Get-AutomationVariable.

So let’s see the outputs of the two cmdlets. First, Get-AzureRmAutomationVariable

As you can see, when we just run this cmdlet directly, it asks for the resource group name and automation account name. Once these are provided, it lists all the variables that are present in the automation account along with properties of each of the automation variable.

There is also an option to get details of a particular automation variable by adding the         -Name parameter and providing the name of the automation variable. This retrieves the details of only that variable as shown below.

Now coming to the second cmdlet, Get-AutomationVariable. This cmdlet directly gives the value of the automation variable as shown below.

This can be used when we only need the value without any other details of the variable.

Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *