If you have several Azure signatures under your Azure account, you first need to select the correct subscription that contains your Azure Resource Manager (RM) virtual machine with the following command.
Set-AzureRmContext -SubscriptionId <your-subscriptionId> -TenantId <your-tenantId>
You can see a list of subscription IDs and tenant IDs:
Get-AzureRmSubscription
After you set the correct Azure Rm context, you can get all the Azure RM virtual machines in the context of the current subscription:
Get-AzureRmVM
This solution was tested on my Azure and VM subscription using the latest version of Azure PowerShell December 2015 (1.0.2).
Hope this helps!
source share