The Remove-AzRecoveryServicesBackupProtectionPolicy cmdlet deletes backup policies for a vault.
Before you can delete a Backup protection policy, the policy must not have any associated Backup items.
Before you delete the policy, make sure that each associated item is associated with some other policy.
To associate another policy with a Backup item, use the Enable-AzRecoveryServicesBackupProtection cmdlet.
Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet before you use the current cmdlet.
The first command gets the Backup protection policy named NewPolicy, and then stores it in the $Pol variable.
The second command removes the policy object in $Pol.
Example 2
Deletes a Backup protection policy from a vault. (autogenerated)
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.