nam
nam

Reputation: 23868

Azure PowerShell: Get-AzVM does not display the output

According to this Official document example from MS Azure team, the following command should display all the VMs in my current subscription. But when I logged-in with my subscription and run the following command, it just brings me back to the command line with no output and no error. I do have VMs in this subscription, and the same login with the same subscription is working for other tasks I am performing in the same session. Question: What I may be missing here, and how can we resolve the issue?

PS C:\Users\MyUserName> Get-azVM
PS C:\Users\MyUserName>

Upvotes: 1

Views: 2152

Answers (1)

Mike Kennedy
Mike Kennedy

Reputation: 394

Are you Signed into Azure Connect-AzAccount

Do you have more than one subscription?
If so you might need to switch subscriptions.

Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"

Upvotes: 2

Related Questions