Skip to content

Instantly share code, notes, and snippets.

@rupertbenbrook
Created September 22, 2016 08:39
Show Gist options
  • Save rupertbenbrook/223a61da5655be6406089fa0d826ac61 to your computer and use it in GitHub Desktop.
Save rupertbenbrook/223a61da5655be6406089fa0d826ac61 to your computer and use it in GitHub Desktop.
A script to list all the Azure VM limits and their current usage across all regions
Get-AzureRmLocation | %{ Get-AzureRmVMUsage -Location $_.Location | Add-Member Location $_.Location -PassThru } | %{ $_ | Add-Member Percent ($_.CurrentValue/$_.Limit*100) -PassThru } | Sort Percent -Descending | ft Location,@{Label="Name";Expression={$_.Name.LocalizedValue}},CurrentValue,Limit,Percent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment