Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created December 6, 2019 16:23
Show Gist options
  • Save PrateekKumarSingh/a927b209e6d523287a3a5b37c177dec8 to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/a927b209e6d523287a3a5b37c177dec8 to your computer and use it in GitHub Desktop.
# capture resource metrics
$ResourceID = (Get-AzResource -ResourceName $ResourceName).ResourceId
$Splat = @{
ResourceId = $ResourceID
MetricName = $MetricName
TimeGrain = $TimeGrain
StartTime = $Start
EndTime = $End
}
$Data = Get-AzMetric @Splat
$Datpoints = $data.data.average.foreach({[int]$_})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment