Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.87k forks source link

[Feature]: Azure Powershell command to list first n Private IP address for a given subnet #26730

Open RSwarnkar opened 3 days ago

RSwarnkar commented 3 days ago

Description of the new feature

Requesting this from this StackOverflow. I have subnet that shows 3 available IPs as below. Is there a quick way to fetch the first 2 available IPs?

It seems there is Az CLI command but no Az PWSH Command. Can this be implemented?

az network vnet subnet list-available-ips --resource-group <your-resource-grp> --vnet-name vnet01 -n subnet-1 --query [0:2]

Proposed implementation details (optional)

List-AzVirtualNetworkSubnetFreeIP -Name my-subnet-name -VnetName my-vnet -ResourceGroupName my-net-rg -Count MAX