Editar

Partilhar via


New-AzCdnDeliveryRuleObject

Create an in-memory object for DeliveryRule.

Syntax

New-AzCdnDeliveryRuleObject
   -Action <IDeliveryRuleAction1[]>
   -Order <Int32>
   [-Condition <IDeliveryRuleCondition[]>]
   [-Name <String>]
   [<CommonParameters>]

Description

Create an in-memory object for DeliveryRule.

Examples

Example 1: Create an in-memory object for AzureCDN DeliveryRule

$cond1 = New-AzCdnDeliveryRuleCookiesConditionObject -Name Cookies -ParameterOperator Equal -ParameterSelector test -ParameterMatchValue test -ParameterNegateCondition $False -ParameterTransform Lowercase
$action1 = New-AzCdnDeliveryRuleResponseHeaderActionObject -Name ModifyResponseHeader -ParameterHeaderAction Append -ParameterHeaderName a1 -ParameterValue a1
$action2 = New-AzCdnDeliveryRuleRequestHeaderActionObject -Name ModifyRequestHeader -ParameterHeaderAction Append -ParameterHeaderName a1 -ParameterValue a1


$conditions = @($cond1)
$actions = @($action1, $action2)
New-AzCdnDeliveryRuleObject -Name "Rule1" -Condition $conditions -Action $actions -Order 1

Name  Order
----  -----
Rule1 1

Create an in-memory object for AzureCDN DeliveryRule

Parameters

-Action

A list of actions that are executed when all the conditions of a rule are satisfied. To construct, see NOTES section for ACTION properties and create a hash table.

Type:IDeliveryRuleAction1[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Condition

A list of conditions that must be matched for the actions to be executed. To construct, see NOTES section for CONDITION properties and create a hash table.

Type:IDeliveryRuleCondition[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of the rule.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Order

The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Outputs

DeliveryRule