Edit

Share via


Edit-AzDataProtectionPolicyTagClientObject

Adds or removes schedule tag in an existing backup policy.

Syntax

RemoveTag (Default)

Edit-AzDataProtectionPolicyTagClientObject
    -Policy <IBackupPolicy>
    -Name <TagName>
    [-RemoveRule]
    [<CommonParameters>]

updateTag

Edit-AzDataProtectionPolicyTagClientObject
    -Policy <IBackupPolicy>
    -Name <TagName>
    -Criteria <IScheduleBasedBackupCriteria[]>
    [<CommonParameters>]

Description

Adds or removes schedule tag in an existing backup policy.

Examples

Example 1: Add Weekly tag to Backup Policy

$criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
DatasourceType            ObjectType
--------------            ----------
{Microsoft.Compute/disks} BackupPolicy

This command adds a weekly tag to given backup policy

Example 2: Remove Weekly tag from Backup Policy

Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
DatasourceType            ObjectType
--------------            ----------
{Microsoft.Compute/disks} BackupPolicy

This command removes Weekly tag from backup policy.

Parameters

-Criteria

Criterias to be associated with the schedule tag. To construct, see NOTES section for CRITERIA properties and create a hash table.

Parameter properties

Type:

IScheduleBasedBackupCriteria[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

updateTag
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Name of the Schedule tag.

Parameter properties

Type:TagName
Default value:None
Accepted values:Daily, Weekly, Monthly, Yearly
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Policy

Backup Policy Object. To construct, see NOTES section for POLICY properties and create a hash table.

Parameter properties

Type:IBackupPolicy
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveRule

Specify whether to remove the tag from the given policy object.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveTag
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

IBackupPolicy