Skip to content

Commit ef0d61a

Browse files
halkazwiniisra-felwyunchi-ms
authored
Update to "Example 1" of "New-AzRouteServer" (#19091)
* Update Example 1 The example had cmdlets with null variables for their parameters which caused those cmdlets to fail. I replaced those variables with string values. * Update New-AzRouteServer.md Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: Yunchi Wang <[email protected]> Co-authored-by: wyunchi-ms <[email protected]>
1 parent 6e4f315 commit ef0d61a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Network/Network/help/New-AzRouteServer.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ The **New-AzRouteServer** cmdlet creates an Azure RouteServer
2323

2424
## EXAMPLES
2525

26-
### Example 1
26+
### Example 1: Create a new router server
2727
```powershell
28-
$subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.0.0/24
29-
$vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $resourceGroupName -Location $resourceGroupLocation -AddressPrefix 10.0.0.0/16 -Subnet $subnet
30-
$subnetId = (Get-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $vnet).Id
31-
$publicIpAddress = New-AzPublicIpAddress -Name $publicIpAddressName -ResourceGroupName $rgName -AllocationMethod Static -Location $rglocation -Sku Standard -Tier Regional
28+
New-AzResourceGroup -Name myResourceGroup -Location eastus
3229
33-
New-AzRouteServer -RouteServerName $routeServerName -ResourceGroupName $resourceGroupName -Location $resourceGroupLocation -HostedSubnet $subnetId -PublicIpAddress $publicIpAddress -HubRoutingPreference "AsPath"
30+
$subnet = New-AzVirtualNetworkSubnetConfig -Name RouteServerSubnet -AddressPrefix 10.0.0.0/24
31+
$vnet = New-AzVirtualNetwork -Name myVNet -ResourceGroupName myResourceGroup -Location eastus -AddressPrefix 10.0.0.0/16 -Subnet $subnet
32+
$subnetId = (Get-AzVirtualNetworkSubnetConfig -Name RouteServerSubnet -VirtualNetwork $vnet).Id
33+
$publicIpAddress = New-AzPublicIpAddress -Name myRouteServerIP -ResourceGroupName myResourceGroup -AllocationMethod Static -Location eastus -Sku Standard -Tier Regional
34+
35+
New-AzRouteServer -RouteServerName myRouteServer -ResourceGroupName myResourceGroup -Location eastus -HostedSubnet $subnetId -PublicIpAddress $publicIpAddress
3436
```
3537

3638
## PARAMETERS

0 commit comments

Comments
 (0)