Az.Compute module: setup and commands
Documentation: Microsoft Learn
Inspect Azure VMs with Get-AzVM, read power state explicitly and manage disks or scale sets without confusing configuration with live status.
Getting it
Install-PSResource -Name Az.Compute from the PowerShell Gallery, or install the Az bundle to get it with everything else.
Examples
Show reference output
Show reference output
What it is for
Use it for VM inventory, power state reporting, and scripted start or deallocate schedules. It is also how you read the extensions installed on a VM when you are chasing a misbehaving agent.
Typical tasks
- List VMs with size and location
- Find deallocated or stopped VMs
- Report unattached managed disks
- Check which extensions a VM has installed
- Start or deallocate a VM on a schedule
- Audit the OS image a VM was built from
Check the installed version
Compare the module path and version with the session used by your scheduled task or automation account. Use it for VM inventory, power state reporting, and scripted start or deallocate schedules. It is also how you read the extensions installed on a VM when you are chasing a misbehaving agent.