Hello, today I had to get a list of VMs from a specific Azure Resource Group and thought to share this, because you may find it useful too.
As there is not directly visible the information regarding the size of an Azure VM, you have to look to the HardwareProfile property.
Below the Gist from my GitHub repo, that you can also find here.
Now that you have this as a base, you can expand it i.e. write-out to a text file, etc.
You can check all the members of a $vm by issuing:
$vm | Get-Member
Note: to connect to your Azure Subscription and use PowerShell use the
Login-AzAccount PowerShell cmdlet.