Set-AzExpressRouteGateway
語法
ByExpressRouteGatewayName (預設值)
Set-AzExpressRouteGateway
-ResourceGroupName <String>
-Name <String>
[-MinScaleUnits <UInt32>]
[-MaxScaleUnits <UInt32>]
[-AllowNonVirtualWanTraffic <Boolean>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByExpressRouteGatewayObject
Set-AzExpressRouteGateway
-InputObject <PSExpressRouteGateway>
[-MinScaleUnits <UInt32>]
[-MaxScaleUnits <UInt32>]
[-AllowNonVirtualWanTraffic <Boolean>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByExpressRouteGatewayResourceId
Set-AzExpressRouteGateway
-ResourceId <String>
[-MinScaleUnits <UInt32>]
[-MaxScaleUnits <UInt32>]
[-AllowNonVirtualWanTraffic <Boolean>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Set-AzExpressRouteGateway Cmdlet 可讓您更新現有 ExpressRouteGateway 的縮放單位,或更新資源標籤。
範例
範例 1
New-AzResourceGroup -Location "West US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testergw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
Set-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testergw" -MinScaleUnits 3
ResourceGroupName : testRG
Name : testergw
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/expressRouteGateways/testergw
Location : West US
MinScaleUnits : 3
Type : Microsoft.Network/expressRouteGateways
ProvisioningState : Succeeded
上述內容會在 Azure 的該資源群組中建立資源群組 “testRG”、虛擬 WAN 和美國西部的虛擬中樞。
此後,將會在具有 2 個縮放單位的虛擬中樞中建立 ExpressRoute 閘道,然後會修改為 3 個縮放單位。
範例 2:將此閘道設定為接受來自非虛擬 WAN 網路的流量。
您可以擷取閘道、設定其 AllowNonVirtualWanTraffic 屬性,並將變更儲存在閘道上,也可以只使用 Set-AzExpressRouteGateway Cmdlet 上的參數
# Option 1 - Retrieve the gateway object, configure it to allow traffic from VNets and persist those changes.
$gateway = Get-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowNonVirtualWanTraffic = $true
$gateway = Set-AzExpressRouteGateway -InputObject $gateway
# Option 2 - Use the cmdlet switch
Set-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001" -AllowNonVirtualWanTraffic $true
範例 3:將此閘道設定為封鎖來自非虛擬 WAN 網路的流量。
您可以擷取閘道、設定其 AllowNonVirtualWanTraffic 屬性,並將變更儲存在閘道上,也可以只使用 Set-AzExpressRouteGateway Cmdlet 上的參數
# Option 1 - Retrieve the gateway object, configure it to block traffic from VNets and persist those changes.
$gateway=Get-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowNonVirtualWanTraffic = $false
$gateway = Set-AzExpressRouteGateway -InputObject $gateway
# Option 2 - Use the cmdlet switch
Set-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001" -AllowNonVirtualWanTraffic $false
參數
-AllowNonVirtualWanTraffic
判斷此閘道是否應該接受來自其他 VNet 的流量
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: True
來自剩餘引數的值: False
-AsJob
在背景執行 Cmdlet
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
需要更新的 ExpressRouteGateway。
ByExpressRouteGatewayObject
Position: Named
必要: True
來自管線的值: True
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-MaxScaleUnits
此 ExpressRouteGateway 的縮放單位數目上限。 有效範圍 > 2
參數屬性
類型: UInt32
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-MinScaleUnits
此 ExpressRouteGateway 的縮放單位數目下限。 有效範圍 > 2
參數屬性
類型: UInt32
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-Name
資源名稱。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
別名: 資源名稱, ExpressRouteGatewayName, 閘道名稱
參數集
ByExpressRouteGatewayName
Position: Named
必要: True
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-ResourceGroupName
要更新之 ExpressRouteGateway 的資源群組名稱。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
參數集
ByExpressRouteGatewayName
Position: Named
必要: True
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-ResourceId
需要更新之 ExpressRouteGateway 的識別碼。
參數屬性
類型: String
預設值: None
支援萬用字元: False
不要顯示: False
參數集
ByExpressRouteGatewayResourceId
Position: Named
必要: True
來自管線的值: False
來自管線按屬性名稱的值: True
來自剩餘引數的值: False
-Tag
代表資源標籤的雜湊表。
參數屬性
類型: Hashtable
預設值: None
支援萬用字元: False
不要顯示: False
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。
指令未執行。
參數屬性
參數集
(All)
Position: Named
必要: False
來自管線的值: False
來自管線按屬性名稱的值: False
來自剩餘引數的值: False
CommonParameters
此 Cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters 。
輸出