PowerTip: List Azure Resource Manager virtual networks with PowerShell

Doctor Scripto

Summary: Use the AzureRM cmdlets to list all available virtual networks in a subscription.

Hey, Scripting Guy! Question I’m doing work for a client who forgot to give me a list of the virtual networks in the client’s Azure subscription. Could you save me some time and show me how to get that list?

Hey, Scripting Guy! Answer Just use the Get-AzureRMVirtualNetwork cmdlet. This will dump the output to the screen in a long list. If you’d like something more readable, such as the name, location and the subnet that it controls, try this one liner:

Get-AzureRmVirtualNetwork | Select-Object Name, Location,@{Name='Network'; Expression={$_.AddressSpace.AddressPrefixes}}

The Doctor

0 comments

Discussion is closed.

Feedback usabilla icon