Perform an Azure Virtual Machine (VM) inventory with PowerShell
To generate quickly an overview of all the Virtual Machines (VMs) in an Azure subscription I made a PowerShell script that uses the Azure Az PowerShell module. This script will do an inventory of all VMs in a subscription.

The following VM information is displayed per subscription:
NamePowerStateRegionResource GroupVM SizeCPU CoresMemory (MB)License TypeOperating SystemOfferSKUPublisherVM GenerationVM Agent versionOS NameOS VersionNIC NameVNetPrivate IP addressPublic IP addressOS disk nameOS disk size (GB)OS storage typeOS disk cachingData disks countData disks namesAdmin usernameIf boot diagnostics is enabledBoot diagnostics storage accountTagsThe time the VM was created
The output will be displayed in the PowerShell console, to a PowerShell GridView output, and saved to a delimited CSV file. The “azurevm-inventory.ps1” script can be found on my GitHub repo, link.