PowerTip: List all virtual network subnets by using PowerShell

Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to identify all the available subnets in a particular virtual network.

Hey, Scripting Guy! Question I’m trying to figure out a way to list all the subnet configurations in a virtual network in Azure Resource Manager. Got any tips?

Hey, Scripting Guy! Answer How about the answer? It’s a matter of combining the Get-AzureRMVirtualNetwork cmdlet and Get-AzureRMVirtualNetworkSubnetConfig. Here is an example:

Get-AzureRmVirtualNetwork -Name HSG-VirtualNetwork -ResourceGroupName HSG-AzureRG | Get-AzureRmVirtualNetworkSubnetConfig | Format-Table

The Doctor

0 comments

Discussion is closed.

Feedback usabilla icon