Merge pull request #6190 from Azure/anavinahar-patch-1

Update Set-AzureRmVirtualNetwork.md
This commit is contained in:
Cormac McCarthy 2018-05-09 17:05:41 -07:00 коммит произвёл GitHub
Родитель 26156e367b 1cf82cb058
Коммит f339cbca4a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -26,21 +26,18 @@ The **Set-AzureRmVirtualNetwork** cmdlet sets the goal state for an Azure virtua
### 1: Creates a virtual network and removes one of its subnets
```
New-AzureRmResourceGroup -Name TestResourceGroup -Location centralus
$frontendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24"
$backendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix "10.0.2.0/24"
$frontendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24" ## Create resource group
$backendSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix "10.0.2.0/24" ## Create backend subnet
$virtualNetwork = New-AzureRmVirtualNetwork -Name MyVirtualNetwork -ResourceGroupName
TestResourceGroup -Location centralus -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet,$backendSubnet
TestResourceGroup -Location centralus -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet,$backendSubnet ## Create virtual network
Remove-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -VirtualNetwork $virtualNetwork
Remove-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -VirtualNetwork $virtualNetwork ## Remove subnet from in memory representation of virtual network
$virtualNetwork | Set-AzureRmVirtualNetwork
$virtualNetwork | Set-AzureRmVirtualNetwork ## Remove subnet from virtual network
```
This example creates a virtual network with two subnets. Then it removes one subnet from
the in-memory representation of the virtual network. The Set-AzureRmVirtualNetwork cmdlet
is then used to write the modified virtual network state on the service side.
This example creates a virtual network called TestResourceGroup with two subnets: frontendSubnet and backendSubnet. Then it removes backendSubnet subnet from the in-memory representation of the virtual network. The Set-AzureRmVirtualNetwork cmdlet is then used to write the modified virtual network state on the service side. When the Set-AzureRmVirtualNetwork cmdlet is executed, the backendSubnet is removed.
## PARAMETERS