能否请您帮助我获取同样适用于Azure托管磁盘的磁盘类型。下面我只得到Premium_LRS和Standard_LRS。但是我还要求磁盘也是 “ HDD或SSD” 。
$Disks = Get-AzureRmDisk -ResourceGroupName $RG.ResourceGroupName | select Name,ResourceGroupName,Sku
foreach ($Disk in $Disks) {
$Name = $Disk.Name
$RG = $Disk.ResourceGroupName
$Final = Get-AzureRmDisk -ResourceGroupName $RG -DiskName $Name | select Name,ResourceGroupName,ManagedBy
$VM = $Final.ManagedBy
$vmrg = $Final.ResourceGroupName
$VmName = ($VM -split '/')[8]
$Type = (Get-AzureRmDisk -ResourceGroupName $RG -DiskName $Name).Type.GetType
Write-Host -Separator " ” $VmName $VMsize $vmrg $Final.Name $Type
}