I wanted to write a PS Script to get the list of SKUs in a region for which certain capabilities (such as MaxDataDiskCount, CpuArchitectureType etc) are enabled.
In my case I wanted the list of VM SKUs in a given region with UltraSSDAvailable capability
Get-AzComputeResourceSku | Where-Object { $.Locations -contains "eastus2euap" -and $.ResourceType.Contains("virtualMachines") }
This prints many lines and the Capability field is an array of objects. I wanted to apply filter on them and shortlist the VM SKUs.
I could come up with the below PS Script
References: i. https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-sku-not-available?tabs=azure-powershell
ii. https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.commands.compute.automation.models.psresourcesku?view=az-ps-latest