How to get the Azure VM storage account type using PowerShell?


To get the Azure VM storage account type using PowerShell, we need to get the Azure VM storage profile setting from the Get-AzVM command.

PS C:\> $vm = Get-AzVM -Name TestVM
PS C:\> $vm.StorageProfile.OsDisk.ManagedDisk.StorageAccountType

Output

To get the storage account type on the multiple VMs from the specific subscription, use the below command.

Get-AzVM | Select Name,ResourceGroupName,
@{N='StorageType';E={$_.StorageProfile.OsDisk.ManagedDisk.StorageAccountType}}

Updated on: 31-Aug-2021

509 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements