1
votes

I was wondering is there a reliable PowerShell script that gets Used Capacity for a storage account in Azure? Current script we are using is inconsistent- sometimes it returns results and sometimes it is blank values.

The script here works fine, just sometimes returns blank values for some accounts, or all.

Script:
#CAPACITY
$SAID = $storageAccount.Id
$usedCapacity = (Get-AzMetric -ResourceId $SAID -MetricName "UsedCapacity").Data
$usedCapacityInMB = $usedCapacity.Average/1024/1024

Many thanks everyone for your help!

1

1 Answers

1
votes