Dela via


Update-AzRouteMap

Uppdatera en routningskarta för en VirtualHub.

Syntax

Update-AzRouteMap
      [-ResourceGroupName <String>]
      [-VirtualHubName <String>]
      [-Name <String>]
      [-RouteMapRule <PSRouteMapRule[]>]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRouteMap
      [-Name <String>]
      [-VirtualHubObject <PSVirtualHub>]
      [-RouteMapRule <PSRouteMapRule[]>]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRouteMap
      [-InputObject <PSRouteMap>]
      [-RouteMapRule <PSRouteMapRule[]>]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzRouteMap
      [-ResourceId <String>]
      [-RouteMapRule <PSRouteMapRule[]>]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Uppdatera en routningskarta för en VirtualHub.

Exempel

Exempel 1

New-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan" -Location "westcentralus" -VirtualWANType "Standard" -AllowVnetToVnetTraffic -AllowBranchToBranchTraffic
$virtualWan = Get-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan"

New-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub" -Location "westcentralus" -AddressPrefix "10.0.0.0/16" -VirtualWan $virtualWan
$virtualHub = Get-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub"

# creating new route map rules and a new route map resource and new routing configuration
$routeMapMatchCriterion1 = New-AzRouteMapRuleCriterion -MatchCondition "Contains" -RoutePrefix @("10.0.0.0/16")
$routeMapActionParameter1 = New-AzRouteMapRuleActionParameter -AsPath @("12345")
$routeMapAction1 = New-AzRouteMapRuleAction -Type "Add" -Parameter @($routeMapActionParameter1)
$routeMapRule1 = New-AzRouteMapRule -Name "rule1" -MatchCriteria @($routeMapMatchCriterion1) -RouteMapRuleAction @($routeMapAction1) -NextStepIfMatched "Continue"

$routeMapMatchCriterion2 = New-AzRouteMapRuleCriterion -MatchCondition "Equals" -AsPath @("12345")
$routeMapAction2 = New-AzRouteMapRuleAction -Type "Drop"
$routeMapRule2 = New-AzRouteMapRule -Name "rule2" -MatchCriteria @($routeMapMatchCriterion2) -RouteMapRuleAction @($routeMapAction2) -NextStepIfMatched "Terminate"

New-AzRouteMap -ResourceGroupName "testRg" -VirtualHubName "testHub" -Name "testRouteMap" -RouteMapRule @($routeMapRule1, $routeMapRule2)
Update-AzRouteMap -ResourceGroupName "testRg" -VirtualHubName "testHub" -Name "testRouteMap" -RouteMapRule @($routeMapRule2)

Name                          : testRouteMap
Id                            : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/routemap0419/providers/Microsoft.Network/virtualHubs/westcentralus_hub1/routeMaps/tes
                                tRouteMap
ProvisioningState             : Succeeded
RouteMapRules                 : [
                                  {
                                    "MatchCriteria": [
                                      {
                                        "MatchCondition": "Equals",
                                        "RoutePrefix": [],
                                        "Community": [],
                                        "AsPath": [
                                          "12345"
                                        ]
                                      }
                                    ],
                                    "Actions": [
                                      {
                                        "Type": "Drop",
                                        "Parameters": []
                                      }
                                    ],
                                    "NextStepIfMatched": "Terminate",
                                    "Name": "rule2"
                                  }
                                ]
AssociatedInboundConnections  : []
AssociatedOutboundConnections : []

Parametrar

-AsJob

Kör cmdlet i bakgrunden

Typ:SwitchParameter
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Typ:SwitchParameter
Alias:cf
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Typ:IAzureContextContainer
Alias:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-InputObject

Routningskartans objekt.

Typ:PSRouteMap
Alias:RouteMap
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-Name

Namnet på routningskartan.

Typ:String
Alias:ResourceName, RouteMapName
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-ResourceGroupName

Resursgruppens namn.

Typ:String
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-ResourceId

Resurs-ID för routningskarta.

Typ:String
Alias:RouteMapId
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-RouteMapRule

Lista över routningskartans regler på vägkartan.

Typ:PSRouteMapRule[]
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-VirtualHubName

Namnet på den virtuella hubben.

Typ:String
Alias:ParentVirtualHubName, ParentResourceName
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-VirtualHubObject

Virtual Hub-objektet.

Typ:PSVirtualHub
Alias:VirtualHub, ParentVirtualHub
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-WhatIf

Visar vad som skulle hända om cmdleten kördes. Cmdleten körs inte.

Typ:SwitchParameter
Alias:wi
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

Indata

PSVirtualHub

String

Utdata

PSRouteMap