【发布时间】:2021-01-12 14:11:01
【问题描述】:
我正在使用 Azure Powershell 脚本来提取一些数据。我想获取 VM 的总磁盘数据大小。有人可以帮忙吗?
$virtualM = Get-AzVM -ResourceGroupName $ResourceName
foreach ($vmachine in $virtualM) {
#Get VM Name and Total data disk size
write-host 'VM NAME: '$vmachine.name 'Data disk total size: '$vmachine.StorageProfile.dataDisks.diskSizeGB
}
#current output VM NAME: VM1 Datadisk total size: 1023 VM NAME: VM2 Datadisk total size: 1023 1023 1023 #what I am trying to get VM NAME: VM1 Datadisk total size: 1023 VM NAME: VM2 Datadisk total size: 3069
【问题讨论】:
标签: azure powershell azure-powershell