編輯

共用方式為


New-AzStorageObjectReplicationPolicyRule

Creates an object replication policy rule.

Syntax

New-AzStorageObjectReplicationPolicyRule
   -SourceContainer <String>
   -DestinationContainer <String>
   [-PrefixMatch <String[]>]
   [-MinCreationTime <DateTime>]
   [-RuleId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzStorageObjectReplicationPolicy cmdlet creates an object replication policy rule, which will be used in Set-AzStorageObjectReplicationPolicy cmdlet.

Examples

Example 1: Create an object replication policy rule with only source and destination account, and show its properties

$rule1 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src1 -DestinationContainer dest1 

$rule1

RuleId SourceContainer DestinationContainer Filters.PrefixMatch Filters.MinCreationTime
------ --------------- -------------------- ------------------- -----------------------
       src1            dest1                {}

This command creates an object replication policy rule with only source and destination account, and show its properties.

Example 2: Create an object replication policy rule with all properties, and show its properties

$rule2 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src -DestinationContainer dest -MinCreationTime 2019-01-01T16:00:00Z -PrefixMatch a,abc,dd

$rule2

RuleId SourceContainer DestinationContainer Filters.PrefixMatch Filters.MinCreationTime
------ --------------- -------------------- ------------------- -----------------------
       src             dest                 {a, abc, dd}        2019-01-01T16:00:00Z

This command an object replication policy rule with all properties, and show its properties.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationContainer

The Destination Container name to replicate to.

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

-MinCreationTime

Blobs created after the time will be replicated to the destination..

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

-PrefixMatch

Filters the results to replicate only blobs whose names begin with the specified prefix.

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

-RuleId

Object Replication Rule Id.

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

-SourceContainer

The Source Container name to replicate from.

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

Inputs

None

Outputs

PSObjectReplicationPolicyRule