Hi @tbgangav-MSFT ,
I have deleted the old variable and created new one as per the above syntax. I could see the commands executed successfully. However, when i checked the values, i didnt get the expected results.
'i have just printed the @array variable and the value from the above. Results are attached in the below screen shot.
$array
New-AzAutomationVariable -AutomationAccountName "TestAutomation" -Name "VMLIST" -Encrypted $False -Value "My String" -ResourceGroupName "AUTOMATION_TESTRG"
Set-AzAutomationVariable -AutomationAccountName "TestAutomation" -Name "VMLIST" -ResourceGroupName "AUTOMATION_TESTRG" -Value $array -Encrypted $False
$Variable = Get-AzAutomationVariable -AutomationAccountName "TestAutomation" -Name "VMLIST" -ResourceGroupName "AUTOMATION_TESTRG"
$Variable.Value
35298-image.png
35465-image.png