書名: Hands-On Networking with Azure作者名: Mohamed Waly本章字數: 74字更新時間: 2021-06-24 18:41:22
Adding address space to a virtual network using PowerShell
To add an address space to a virtual network, you need retrieve the virtual network first and store it in a variable by running the following cmdlet:
$VNet = Get-AzureRMVirtualNetwork -ResourceGroupName PacktPub -Name PSVNet
Then, you can add the address space by running the following cmdlet:
$VNet.AddressSpace.AddressPrefixes.Add("10.1.0.0/16")
Finally, you need to save the changes you have made by running the following cmdlet:
Set-AzureRmVirtualNetwork -VirtualNetwork $VNet