3

I am trying to execute a powershell script to create resources on the Azure infrastructure. I have installed Azure CLI on my machine and followed all the steps to login using az login command. I have also setup my subscription using az account set --subscription "My Demos" command.

Now I want to execute the powershell script using this setup.

Can anyone help me to fix this issue?

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
santosh kumar patro
  • 7,231
  • 22
  • 71
  • 143

1 Answers1

3

Please add the word powershell before the powershell scripts when running in azure cli.

Like below:

powershell Get-AzVM -ResourceGroupName "xxx" -Name "xxx" -Status

enter image description here

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60