Skip to content

Instantly share code, notes, and snippets.

@rupertbenbrook
rupertbenbrook / Dump-AzureRmVMUsageLimits.ps1
Created September 22, 2016 08:39
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
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"deploymentLocation": {
"defaultValue": "westeurope",
"type": "string"
},
"vmSize": {
"defaultValue": "Standard_D1_v2",