diff --git a/src/DataProtection/Az.DataProtection.format.ps1xml b/src/DataProtection/Az.DataProtection.format.ps1xml
index b16896515565..da279660003c 100644
--- a/src/DataProtection/Az.DataProtection.format.ps1xml
+++ b/src/DataProtection/Az.DataProtection.format.ps1xml
@@ -35,6 +35,34 @@
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesCreateOrUpdateAcceptedResponseHeaders
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesCreateOrUpdateAcceptedResponseHeaders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureAsyncOperation
+
+
+ Location
+
+
+
+
+
+
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesDeleteAcceptedResponseHeaders
@@ -69,6 +97,176 @@
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesResumeBackupsAcceptedResponseHeaders
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesResumeBackupsAcceptedResponseHeaders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureAsyncOperation
+
+
+ Location
+
+
+ RetryAfter
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesResumeProtectionAcceptedResponseHeaders
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesResumeProtectionAcceptedResponseHeaders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureAsyncOperation
+
+
+ Location
+
+
+ RetryAfter
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesStopProtectionAcceptedResponseHeaders
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesStopProtectionAcceptedResponseHeaders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureAsyncOperation
+
+
+ Location
+
+
+ RetryAfter
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesSuspendBackupsAcceptedResponseHeaders
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesSuspendBackupsAcceptedResponseHeaders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureAsyncOperation
+
+
+ Location
+
+
+ RetryAfter
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesSyncBackupInstanceAcceptedResponseHeaders
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesSyncBackupInstanceAcceptedResponseHeaders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureAsyncOperation
+
+
+ Location
+
+
+ RetryAfter
+
+
+
+
+
+
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.BackupInstancesTriggerRehydrateAcceptedResponseHeaders
@@ -384,9 +582,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource
@@ -412,9 +610,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AbsoluteDeleteOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AbsoluteDeleteOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AbsoluteDeleteOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AbsoluteDeleteOption
@@ -440,9 +638,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AdHocBackupRuleOptions
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AdHocBackupRuleOptions
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AdHocBackupRuleOptions
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AdHocBackupRuleOptions
@@ -462,9 +660,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AdhocBackupTriggerOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AdhocBackupTriggerOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AdhocBackupTriggerOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AdhocBackupTriggerOption
@@ -484,9 +682,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AdhocBasedTriggerContext
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AdhocBasedTriggerContext
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AdhocBasedTriggerContext
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AdhocBasedTriggerContext
@@ -506,9 +704,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AuthCredentials
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AuthCredentials
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AuthCredentials
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AuthCredentials
@@ -528,9 +726,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupDiscreteRecoveryPoint
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupDiscreteRecoveryPoint
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupDiscreteRecoveryPoint
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupDiscreteRecoveryPoint
@@ -598,9 +796,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesRequest
@@ -632,9 +830,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesRequestResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesRequestResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesRequestResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesRequestResource
@@ -678,9 +876,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesResponse
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesResponse
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesResponse
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesResponse
@@ -700,9 +898,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesResponseResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesResponseResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupFindRestorableTimeRangesResponseResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupFindRestorableTimeRangesResponseResource
@@ -722,9 +920,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJob
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJob
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJob
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJob
@@ -906,9 +1104,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJobResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJobResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJobResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJobResource
@@ -928,9 +1126,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJobResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJobResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJobResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJobResourceList
@@ -950,9 +1148,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupParams
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupParams
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupParams
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupParams
@@ -978,9 +1176,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPoint
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPoint
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPoint
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPoint
@@ -1000,9 +1198,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointBasedRestoreRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointBasedRestoreRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointBasedRestoreRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointBasedRestoreRequest
@@ -1012,6 +1210,9 @@
+
+
+
@@ -1025,6 +1226,9 @@
SourceDataStoreType
+
+ SourceResourceId
+
RecoveryPointId
@@ -1034,9 +1238,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointResource
@@ -1056,9 +1260,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointResourceList
@@ -1078,9 +1282,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryTimeBasedRestoreRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryTimeBasedRestoreRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryTimeBasedRestoreRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryTimeBasedRestoreRequest
@@ -1090,6 +1294,9 @@
+
+
+
@@ -1103,6 +1310,9 @@
SourceDataStoreType
+
+ SourceResourceId
+
RecoveryPointTime
@@ -1112,9 +1322,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRehydrationRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRehydrationRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRehydrationRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRehydrationRequest
@@ -1146,9 +1356,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRestoreRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRestoreRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRestoreRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRestoreRequest
@@ -1158,6 +1368,9 @@
+
+
+
@@ -1168,15 +1381,18 @@
SourceDataStoreType
+
+ SourceResourceId
+
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRestoreWithRehydrationRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRestoreWithRehydrationRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRestoreWithRehydrationRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRestoreWithRehydrationRequest
@@ -1189,6 +1405,9 @@
+
+
+
@@ -1208,6 +1427,9 @@
SourceDataStoreType
+
+ SourceResourceId
+
RehydrationPriority
@@ -1220,9 +1442,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRule
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRule
@@ -1248,9 +1470,31 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureOperationalStoreParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureMonitorAlertSettings
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureOperationalStoreParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureMonitorAlertSettings
+
+
+
+
+
+
+
+
+
+
+
+ AlertsForAllJobFailure
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureOperationalStoreParameters
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureOperationalStoreParameters
@@ -1282,9 +1526,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureRetentionRule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureRetentionRule
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureRetentionRule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureRetentionRule
@@ -1316,9 +1560,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupCriteria
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupCriteria
@@ -1338,9 +1582,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstance
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstance
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstance
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstance
@@ -1356,6 +1600,9 @@
+
+
+
@@ -1372,15 +1619,18 @@
ProvisioningState
+
+ ValidationType
+
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResourceList
@@ -1400,9 +1650,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupParameters
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupParameters
@@ -1422,9 +1672,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupPolicy
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupPolicy
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupPolicy
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupPolicy
@@ -1450,9 +1700,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupSchedule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupSchedule
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupSchedule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupSchedule
@@ -1478,9 +1728,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupVault
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupVault
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupVault
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupVault
@@ -1506,9 +1756,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupVaultResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupVaultResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupVaultResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupVaultResource
@@ -1540,9 +1790,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupVaultResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupVaultResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupVaultResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupVaultResourceList
@@ -1562,9 +1812,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicy
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicy
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicy
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicy
@@ -1590,9 +1840,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicyResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicyResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicyResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicyResource
@@ -1612,9 +1862,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicyResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicyResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicyResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicyResourceList
@@ -1634,9 +1884,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BasePolicyRule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BasePolicyRule
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BasePolicyRule
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BasePolicyRule
@@ -1662,9 +1912,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CheckNameAvailabilityRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CheckNameAvailabilityRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CheckNameAvailabilityRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CheckNameAvailabilityRequest
@@ -1684,9 +1934,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CheckNameAvailabilityResult
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CheckNameAvailabilityResult
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CheckNameAvailabilityResult
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CheckNameAvailabilityResult
@@ -1718,9 +1968,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryDisplay
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryDisplay
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryDisplay
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryDisplay
@@ -1758,9 +2008,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryForLogSpecification
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryForLogSpecification
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryForLogSpecification
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryForLogSpecification
@@ -1792,9 +2042,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryResponse
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryResponse
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryResponse
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryResponse
@@ -1814,9 +2064,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryValueForSingleApi
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryValueForSingleApi
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ClientDiscoveryValueForSingleApi
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ClientDiscoveryValueForSingleApi
@@ -1848,9 +2098,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CopyOnExpiryOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CopyOnExpiryOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CopyOnExpiryOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CopyOnExpiryOption
@@ -1870,9 +2120,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CopyOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CopyOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CopyOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CopyOption
@@ -1892,9 +2142,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CustomCopyOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CustomCopyOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CustomCopyOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CustomCopyOption
@@ -1920,9 +2170,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Datasource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Datasource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Datasource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Datasource
@@ -1972,9 +2222,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DatasourceSet
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DatasourceSet
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DatasourceSet
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DatasourceSet
@@ -2030,9 +2280,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DataStoreInfoBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DataStoreInfoBase
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DataStoreInfoBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DataStoreInfoBase
@@ -2058,9 +2308,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DataStoreParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DataStoreParameters
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DataStoreParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DataStoreParameters
@@ -2086,9 +2336,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Day
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Day
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Day
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Day
@@ -2114,9 +2364,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DeleteOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DeleteOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DeleteOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DeleteOption
@@ -2142,9 +2392,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppBaseResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppBaseResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppBaseResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppBaseResource
@@ -2164,9 +2414,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppBaseResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppBaseResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppBaseResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppBaseResourceList
@@ -2186,9 +2436,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppIdentityDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppIdentityDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppIdentityDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppIdentityDetails
@@ -2214,9 +2464,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppResource
@@ -2236,9 +2486,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppResourceList
@@ -2258,9 +2508,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppTrackedResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppTrackedResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppTrackedResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppTrackedResource
@@ -2292,9 +2542,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppTrackedResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppTrackedResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppTrackedResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppTrackedResourceList
@@ -2314,9 +2564,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppTrackedResourceTags
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppTrackedResourceTags
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppTrackedResourceTags
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppTrackedResourceTags
@@ -2336,9 +2586,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppWorkerRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppWorkerRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppWorkerRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppWorkerRequest
@@ -2382,9 +2632,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppWorkerRequestHeaders
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppWorkerRequestHeaders
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppWorkerRequestHeaders
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppWorkerRequestHeaders
@@ -2404,9 +2654,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppWorkerRequestParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppWorkerRequestParameters
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DppWorkerRequestParameters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DppWorkerRequestParameters
@@ -2426,9 +2676,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Error
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Error
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Error
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Error
@@ -2460,9 +2710,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ExportJobsResult
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ExportJobsResult
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ExportJobsResult
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ExportJobsResult
@@ -2500,9 +2750,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationRequest
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationRequest
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationRequest
@@ -2534,9 +2784,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationRequestBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationRequestBase
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationRequestBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationRequestBase
@@ -2556,9 +2806,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationResponse
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationResponse
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationResponse
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationResponse
@@ -2584,9 +2834,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationResponseBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationResponseBase
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.FeatureValidationResponseBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.FeatureValidationResponseBase
@@ -2606,9 +2856,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ImmediateCopyOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ImmediateCopyOption
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ImmediateCopyOption
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ImmediateCopyOption
@@ -2628,9 +2878,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.InnerError
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.InnerError
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.InnerError
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.InnerError
@@ -2650,9 +2900,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.InnerErrorAdditionalInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.InnerErrorAdditionalInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.InnerErrorAdditionalInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.InnerErrorAdditionalInfo
@@ -2672,9 +2922,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ItemLevelRestoreCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ItemLevelRestoreCriteria
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ItemLevelRestoreCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ItemLevelRestoreCriteria
@@ -2694,9 +2944,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ItemLevelRestoreTargetInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ItemLevelRestoreTargetInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ItemLevelRestoreTargetInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ItemLevelRestoreTargetInfo
@@ -2728,9 +2978,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobExtendedInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobExtendedInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobExtendedInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobExtendedInfo
@@ -2762,9 +3012,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobExtendedInfoAdditionalDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobExtendedInfoAdditionalDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobExtendedInfoAdditionalDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobExtendedInfoAdditionalDetails
@@ -2784,9 +3034,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobSubTask
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobSubTask
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobSubTask
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobSubTask
@@ -2824,9 +3074,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobSubTaskAdditionalDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobSubTaskAdditionalDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.JobSubTaskAdditionalDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.JobSubTaskAdditionalDetails
@@ -2846,9 +3096,77 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationExtendedInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.KubernetesPvRestoreCriteria
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.KubernetesPvRestoreCriteria
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ObjectType
+
+
+ Name
+
+
+ StorageClassName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.KubernetesStorageClassRestoreCriteria
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.KubernetesStorageClassRestoreCriteria
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ObjectType
+
+
+ Provisioner
+
+
+ SelectedStorageClassName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationExtendedInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationExtendedInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationExtendedInfo
@@ -2868,9 +3186,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationJobExtendedInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationJobExtendedInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationJobExtendedInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationJobExtendedInfo
@@ -2896,9 +3214,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationResource
@@ -2936,9 +3254,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.PatchResourceRequestInputTags
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.PatchResourceRequestInputTags
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.PatchResourceRequestInputTags
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.PatchResourceRequestInputTags
@@ -2958,9 +3276,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.PolicyInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.PolicyInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.PolicyInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.PolicyInfo
@@ -2986,9 +3304,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ProtectionStatusDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ProtectionStatusDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ProtectionStatusDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ProtectionStatusDetails
@@ -3008,9 +3326,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RangeBasedItemLevelRestoreCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RangeBasedItemLevelRestoreCriteria
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RangeBasedItemLevelRestoreCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RangeBasedItemLevelRestoreCriteria
@@ -3042,9 +3360,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RecoveryPointDataStoreDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RecoveryPointDataStoreDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RecoveryPointDataStoreDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RecoveryPointDataStoreDetails
@@ -3100,9 +3418,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RecoveryPointsFilters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RecoveryPointsFilters
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RecoveryPointsFilters
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RecoveryPointsFilters
@@ -3152,9 +3470,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuard
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuard
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuard
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuard
@@ -3162,13 +3480,13 @@
-
+
-
+
-
+
@@ -3178,13 +3496,13 @@
AllowAutoApproval
- Description
+ CriticalOperationExclusionList
- ProvisioningState
+ Description
- VaultCriticalOperationExclusionList
+ ProvisioningState
@@ -3192,9 +3510,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuardOperation
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuardOperation
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuardOperation
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuardOperation
@@ -3220,9 +3538,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuardResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuardResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuardResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuardResource
@@ -3272,9 +3590,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuardResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuardResourceList
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceGuardResourceList
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceGuardResourceList
@@ -3294,9 +3612,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceMoveDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceMoveDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ResourceMoveDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ResourceMoveDetails
@@ -3340,9 +3658,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestorableTimeRange
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestorableTimeRange
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestorableTimeRange
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestorableTimeRange
@@ -3374,9 +3692,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreFilesTargetInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreFilesTargetInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreFilesTargetInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreFilesTargetInfo
@@ -3408,9 +3726,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreJobRecoveryPointDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreJobRecoveryPointDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreJobRecoveryPointDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreJobRecoveryPointDetails
@@ -3436,9 +3754,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreTargetInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreTargetInfo
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreTargetInfo
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreTargetInfo
@@ -3470,9 +3788,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreTargetInfoBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreTargetInfoBase
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreTargetInfoBase
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreTargetInfoBase
@@ -3504,9 +3822,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RetentionTag
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RetentionTag
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RetentionTag
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RetentionTag
@@ -3532,9 +3850,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ScheduleBasedBackupCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ScheduleBasedBackupCriteria
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ScheduleBasedBackupCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ScheduleBasedBackupCriteria
@@ -3584,9 +3902,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ScheduleBasedTriggerContext
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ScheduleBasedTriggerContext
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ScheduleBasedTriggerContext
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ScheduleBasedTriggerContext
@@ -3606,9 +3924,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreBasedAuthCredentials
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreBasedAuthCredentials
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreBasedAuthCredentials
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreBasedAuthCredentials
@@ -3628,9 +3946,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreResource
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreResource
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreResource
@@ -3640,6 +3958,9 @@
+
+
+
@@ -3650,15 +3971,18 @@
Uri
+
+ Value
+
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.StorageSetting
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.StorageSetting
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.StorageSetting
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.StorageSetting
@@ -3678,9 +4002,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SupportedFeature
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SupportedFeature
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SupportedFeature
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SupportedFeature
@@ -3712,9 +4036,31 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SystemData
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SyncBackupInstanceRequest
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SyncBackupInstanceRequest
+
+
+
+
+
+
+
+
+
+
+
+ SyncType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SystemData
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SystemData
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SystemData
@@ -3764,9 +4110,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TaggingCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TaggingCriteria
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TaggingCriteria
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TaggingCriteria
@@ -3792,9 +4138,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TargetDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TargetDetails
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TargetDetails
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TargetDetails
@@ -3826,9 +4172,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TriggerContext
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TriggerContext
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TriggerContext
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TriggerContext
@@ -3848,9 +4194,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.UserFacingError
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.UserFacingError
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.UserFacingError
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.UserFacingError
@@ -3900,9 +4246,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.UserFacingErrorProperties
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.UserFacingErrorProperties
- Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.UserFacingErrorProperties
+ Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.UserFacingErrorProperties
diff --git a/src/DataProtection/Az.DataProtection.psd1 b/src/DataProtection/Az.DataProtection.psd1
index 275d0b14816a..92d5deb1b37c 100644
--- a/src/DataProtection/Az.DataProtection.psd1
+++ b/src/DataProtection/Az.DataProtection.psd1
@@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
-# Generated on: 12/31/2021
+# Generated on: 6/13/2022
#
@{
@@ -12,7 +12,7 @@
RootModule = './Az.DataProtection.psm1'
# Version number of this module.
-ModuleVersion = '0.3.1'
+ModuleVersion = '0.4.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
@@ -80,6 +80,7 @@ FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc',
'Get-AzDataProtectionOperation',
'Get-AzDataProtectionPolicyTemplate',
'Get-AzDataProtectionRecoveryPoint',
+ 'Get-AzDataProtectionResourceGuard',
'Initialize-AzDataProtectionBackupInstance',
'Initialize-AzDataProtectionRestoreRequest',
'New-AzDataProtectionBackupInstance',
@@ -88,15 +89,22 @@ FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc',
'New-AzDataProtectionBackupVaultStorageSettingObject',
'New-AzDataProtectionPolicyTagCriteriaClientObject',
'New-AzDataProtectionPolicyTriggerScheduleClientObject',
+ 'New-AzDataProtectionResourceGuard',
'New-AzDataProtectionRetentionLifeCycleClientObject',
'Remove-AzDataProtectionBackupInstance',
'Remove-AzDataProtectionBackupPolicy',
'Remove-AzDataProtectionBackupVault',
+ 'Remove-AzDataProtectionResourceGuard',
+ 'Resume-AzDataProtectionBackupInstanceProtection',
'Search-AzDataProtectionBackupInstanceInAzGraph',
'Search-AzDataProtectionJobInAzGraph',
'Start-AzDataProtectionBackupInstanceRestore',
+ 'Stop-AzDataProtectionBackupInstanceProtection',
+ 'Suspend-AzDataProtectionBackupInstanceBackup',
+ 'Sync-AzDataProtectionBackupInstance',
'Update-AzDataProtectionBackupInstanceAssociatedPolicy',
- 'Update-AzDataProtectionBackupVault'
+ 'Update-AzDataProtectionBackupVault',
+ 'Update-AzDataProtectionResourceGuard'
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
@@ -134,7 +142,12 @@ PrivateData = @{
# IconUri = ''
# ReleaseNotes of this module
- ReleaseNotes = '* Fixed trigger schedule client for ''New-AzDataProtectionPolicyTriggerScheduleClientObject'''
+ ReleaseNotes = '* Added support for CRUD of resource guard resource.
+* Added support for protection related commands with swagger refresh
+ - Resume-AzDataProtectionBackupInstanceProtection
+ - Stop-AzDataProtectionBackupInstanceProtection
+ - Suspend-AzDataProtectionBackupInstanceBackup
+ - Sync-AzDataProtectionBackupInstance'
# Prerelease string of this module
# Prerelease = ''
diff --git a/src/DataProtection/Az.DataProtection.psm1 b/src/DataProtection/Az.DataProtection.psm1
index c5d294f7718a..c2b95760209c 100644
--- a/src/DataProtection/Az.DataProtection.psm1
+++ b/src/DataProtection/Az.DataProtection.psm1
@@ -1,6 +1,6 @@
# region Generated
-# ----------------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
+ # ----------------------------------------------------------------------------------
+ # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -12,92 +12,104 @@
# limitations under the License.
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
-# ----------------------------------------------------------------------------------
-# Load required Az.Accounts module
-$accountsName = 'Az.Accounts'
-$accountsModule = Get-Module -Name $accountsName
-if(-not $accountsModule) {
- $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
- if(Test-Path -Path $localAccountsPath) {
- $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
- if($localAccounts) {
- $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
- }
- }
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
if(-not $accountsModule) {
- $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
- if($hasAdequateVersion) {
- $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
+ }
}
}
-}
-if(-not $accountsModule) {
- Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
-} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
- Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
-}
-Write-Information "Loaded Module '$($accountsModule.Name)'"
-# Load the private module dll
-$null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DataProtection.private.dll')
-# Get the private module's instance
-$instance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Module]::Instance
-# Ask for the shared functionality table
-$VTable = Register-AzModule
-# Tweaks the pipeline on module load
-$instance.OnModuleLoad = $VTable.OnModuleLoad
-
-# Tweaks the pipeline per call
-$instance.OnNewRequest = $VTable.OnNewRequest
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
-# Gets shared parameter values
-$instance.GetParameterValue = $VTable.GetParameterValue
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.DataProtection.private.dll')
-# Allows shared module to listen to events from this module
-$instance.EventListener = $VTable.EventListener
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Module]::Instance
-# Gets shared argument completers
-$instance.ArgumentCompleter = $VTable.ArgumentCompleter
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
-# The name of the currently selected Azure profile
-$instance.ProfileName = $VTable.ProfileName
+ # Following two delegates are added for telemetry
+ $instance.GetTelemetryId = $VTable.GetTelemetryId
+ $instance.Telemetry = $VTable.Telemetry
+
-# Load the custom module
-$customModulePath = Join-Path $PSScriptRoot './custom/Az.DataProtection.custom.psm1'
-if(Test-Path $customModulePath) {
- $null = Import-Module -Name $customModulePath
-}
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
-# Export nothing to clear implicit exports
-Export-ModuleMember
-# Export proxy cmdlet scripts
-$exportsPath = Join-Path $PSScriptRoot './exports'
-$directories = Get-ChildItem -Directory -Path $exportsPath
-$profileDirectory = $null
-if($instance.ProfileName) {
- if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
- $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
- } else {
- # Don't export anything if the profile doesn't exist for the module
- $exportsPath = $null
- Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.DataProtection.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
}
-} elseif(($directories | Measure-Object).Count -gt 0) {
- # Load the last folder if no profile is selected
- $profileDirectory = $directories | Select-Object -Last 1
-}
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
-if($profileDirectory) {
- Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
- $exportsPath = $profileDirectory.FullName
-}
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
-if($exportsPath) {
- Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
- $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
- Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
-}
-# Finalize initialization of this module
-$instance.Init();
-Write-Information "Loaded Module '$($instance.Name)'"
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
# endregion
diff --git a/src/DataProtection/Changelog.md b/src/DataProtection/Changelog.md
index 16295d611295..a731302dff36 100644
--- a/src/DataProtection/Changelog.md
+++ b/src/DataProtection/Changelog.md
@@ -19,6 +19,14 @@
-->
## Upcoming Release
+## Version 0.4.0
+* Added support for CRUD of resource guard resource.
+* Added support for protection related commands with swagger refresh
+ - Resume-AzDataProtectionBackupInstanceProtection
+ - Stop-AzDataProtectionBackupInstanceProtection
+ - Suspend-AzDataProtectionBackupInstanceBackup
+ - Sync-AzDataProtectionBackupInstance
+
## Version 0.3.1
* Fixed trigger schedule client for `New-AzDataProtectionPolicyTriggerScheduleClientObject`
diff --git a/src/DataProtection/DataProtection.sln b/src/DataProtection/DataProtection.sln
index 55690a5a37a1..4168b1ab028d 100644
--- a/src/DataProtection/DataProtection.sln
+++ b/src/DataProtection/DataProtection.sln
@@ -3,17 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{AD8D1817-2358-4320-B718-E92CA4C74FE9}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{8B37AE1D-B764-4A41-B018-9BA0E911A79A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{1C133492-9CF9-444E-8794-5789DA6FE530}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{D705EA30-0516-432A-BE2C-D248BF20C76F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{6AED1BBF-69B3-45B7-81FE-85D5190495FE}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{5410B86A-CB47-4AE6-8679-4A4501B96AB3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{91FEB133-C265-4E93-BA74-591F1F939FE0}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{70BA4779-D992-4F6F-8025-8DE925D55A7B}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{090FC6B6-DA04-4DB8-BF49-6422A402D6F7}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{CA4F659D-DCDA-4ABF-87CD-82E433F86685}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataProtection", "Az.DataProtection.csproj", "{A3E6B273-1352-4D22-8459-788D33861F0B}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataProtection", "Az.DataProtection.csproj", "{8D1ABE91-66E5-43AF-B28E-E5D506335D60}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -28,77 +28,77 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Debug|x64.ActiveCfg = Debug|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Debug|x64.Build.0 = Debug|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Debug|x86.ActiveCfg = Debug|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Debug|x86.Build.0 = Debug|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Release|Any CPU.Build.0 = Release|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Release|x64.ActiveCfg = Release|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Release|x64.Build.0 = Release|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Release|x86.ActiveCfg = Release|Any CPU
- {AD8D1817-2358-4320-B718-E92CA4C74FE9}.Release|x86.Build.0 = Release|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Debug|x64.Build.0 = Debug|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Debug|x86.Build.0 = Debug|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Release|Any CPU.Build.0 = Release|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Release|x64.ActiveCfg = Release|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Release|x64.Build.0 = Release|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Release|x86.ActiveCfg = Release|Any CPU
- {1C133492-9CF9-444E-8794-5789DA6FE530}.Release|x86.Build.0 = Release|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Debug|x64.ActiveCfg = Debug|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Debug|x64.Build.0 = Debug|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Debug|x86.ActiveCfg = Debug|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Debug|x86.Build.0 = Debug|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Release|Any CPU.Build.0 = Release|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Release|x64.ActiveCfg = Release|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Release|x64.Build.0 = Release|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Release|x86.ActiveCfg = Release|Any CPU
- {6AED1BBF-69B3-45B7-81FE-85D5190495FE}.Release|x86.Build.0 = Release|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Debug|x64.ActiveCfg = Debug|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Debug|x64.Build.0 = Debug|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Debug|x86.ActiveCfg = Debug|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Debug|x86.Build.0 = Debug|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Release|Any CPU.Build.0 = Release|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Release|x64.ActiveCfg = Release|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Release|x64.Build.0 = Release|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Release|x86.ActiveCfg = Release|Any CPU
- {91FEB133-C265-4E93-BA74-591F1F939FE0}.Release|x86.Build.0 = Release|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Debug|x64.ActiveCfg = Debug|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Debug|x64.Build.0 = Debug|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Debug|x86.ActiveCfg = Debug|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Debug|x86.Build.0 = Debug|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Release|Any CPU.Build.0 = Release|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Release|x64.ActiveCfg = Release|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Release|x64.Build.0 = Release|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Release|x86.ActiveCfg = Release|Any CPU
- {090FC6B6-DA04-4DB8-BF49-6422A402D6F7}.Release|x86.Build.0 = Release|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Debug|x64.Build.0 = Debug|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Debug|x86.Build.0 = Debug|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Release|Any CPU.Build.0 = Release|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Release|x64.ActiveCfg = Release|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Release|x64.Build.0 = Release|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Release|x86.ActiveCfg = Release|Any CPU
- {A3E6B273-1352-4D22-8459-788D33861F0B}.Release|x86.Build.0 = Release|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Debug|x64.Build.0 = Debug|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Debug|x86.Build.0 = Debug|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Release|x64.ActiveCfg = Release|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Release|x64.Build.0 = Release|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Release|x86.ActiveCfg = Release|Any CPU
+ {8B37AE1D-B764-4A41-B018-9BA0E911A79A}.Release|x86.Build.0 = Release|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Debug|x64.Build.0 = Debug|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Debug|x86.Build.0 = Debug|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Release|x64.ActiveCfg = Release|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Release|x64.Build.0 = Release|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Release|x86.ActiveCfg = Release|Any CPU
+ {D705EA30-0516-432A-BE2C-D248BF20C76F}.Release|x86.Build.0 = Release|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Debug|x64.Build.0 = Debug|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Debug|x86.Build.0 = Debug|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Release|x64.ActiveCfg = Release|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Release|x64.Build.0 = Release|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Release|x86.ActiveCfg = Release|Any CPU
+ {5410B86A-CB47-4AE6-8679-4A4501B96AB3}.Release|x86.Build.0 = Release|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Debug|x64.Build.0 = Debug|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Debug|x86.Build.0 = Debug|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Release|x64.ActiveCfg = Release|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Release|x64.Build.0 = Release|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Release|x86.ActiveCfg = Release|Any CPU
+ {70BA4779-D992-4F6F-8025-8DE925D55A7B}.Release|x86.Build.0 = Release|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Debug|x64.Build.0 = Debug|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Debug|x86.Build.0 = Debug|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Release|x64.ActiveCfg = Release|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Release|x64.Build.0 = Release|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Release|x86.ActiveCfg = Release|Any CPU
+ {CA4F659D-DCDA-4ABF-87CD-82E433F86685}.Release|x86.Build.0 = Release|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Debug|x64.Build.0 = Debug|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Debug|x86.Build.0 = Debug|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Release|x64.ActiveCfg = Release|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Release|x64.Build.0 = Release|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Release|x86.ActiveCfg = Release|Any CPU
+ {8D1ABE91-66E5-43AF-B28E-E5D506335D60}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/src/DataProtection/Properties/AssemblyInfo.cs b/src/DataProtection/Properties/AssemblyInfo.cs
index 21c8286f4336..7913a292a6b8 100644
--- a/src/DataProtection/Properties/AssemblyInfo.cs
+++ b/src/DataProtection/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: Guid("ab240bd4-c397-4629-a993-21763b35faed")]
-[assembly: AssemblyVersion("0.3.1")]
-[assembly: AssemblyFileVersion("0.3.1")]
+[assembly: AssemblyVersion("0.4.0")]
+[assembly: AssemblyFileVersion("0.4.0")]
diff --git a/src/DataProtection/README.md b/src/DataProtection/README.md
index 1ba71b18e621..4ea2c40c141e 100644
--- a/src/DataProtection/README.md
+++ b/src/DataProtection/README.md
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the DataProtection service.
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
## Module Requirements
-- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
@@ -36,16 +36,54 @@ This file contains the configuration for generating My API from the OpenAPI spec
# it's the same options as command line options, just drop the double-dash!
require:
- $(this-folder)/../readme.azure.noprofile.md
-input-file: https://github.com/Azure/azure-rest-api-specs/blob/e048b46b2c40d62fabd94c783dcfeabbd83be831/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2021-07-01/dataprotection.json
+input-file: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2022-04-01/dataprotection.json
title: DataProtection
directive:
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}"].delete
transform: $["description"] = "Delete a backupInstances"
+ - where:
+ parameter-name: AzureMonitorAlertSettingAlertsForAllJobFailure
+ set:
+ parameter-name: AzureMonitorAlertsForAllJobFailure
+ parameter-description: Parameter to Enable or Disable built-in azure monitor alerts for job failures. Security alerts cannot be disabled.
+ - where:
+ parameter-name: VaultCriticalOperationExclusionList
+ set:
+ parameter-name: CriticalOperationExclusionList
+ clear-alias: true
- where:
verb: Get
subject: BackupVaultResource.*
hide: true
+ - where:
+ verb: Get
+ subject: ResourceGuardResource
+ variant: Get1
+ set:
+ subject: ResourceGuard
+ - where:
+ subject: ResourceGuard
+ parameter-name: SName
+ set:
+ parameter-name: Name
+ clear-alias: true
+ - where:
+ subject: ResourceGuard.+
+ remove: true
+ - where:
+ verb: Update
+ subject: ResourceGuard
+ remove: true
+ - where:
+ verb: Set
+ subject: ResourceGuard.*
+ set:
+ verb: New
+ - where:
+ verb: New
+ subject: ResourceGuard
+ hide: true
- where:
subject: RecoveryPoint
variant: List
@@ -72,6 +110,17 @@ directive:
verb: Get
subject: ExportJobsOperationResult
remove: true
+ - where:
+ verb: Resume
+ subject: Backup$
+ remove: true
+ - where:
+ subject: Context$|OperationResult$
+ remove: true
+ - where:
+ verb: Sync
+ variant: Sync$|SyncViaIdentity$|SyncViaIdentityExpanded$
+ remove: true
- where:
verb: Get
subject: OperationResult
@@ -108,9 +157,6 @@ directive:
verb: Find
variant: ^Find$|^FindViaIdentity$|^FindViaIdentityExpanded$
remove: true
- - where:
- subject: ^ResourceGuard
- remove: true
- where:
verb: Get
subject: BackupVault
@@ -136,6 +182,14 @@ directive:
- where:
verb: Test
hide: true
+ - where:
+ property-name: AzureMonitorAlertSettingAlertsForAllJobFailure
+ set:
+ property-name: AzureMonitorAlertsForAllJobFailure
+ - where:
+ property-name: VaultCriticalOperationExclusionList
+ set:
+ property-name: CriticalOperationExclusionList
- where:
model-name: BackupVaultResource
set:
@@ -159,16 +213,16 @@ directive:
- SystemData
- from: source-file-csharp
where: $
- transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicy Property');
+ transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicy Property');
- from: source-file-csharp
where: $
- transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ITriggerContext Trigger');
+ transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ITriggerContext Trigger');
- from: source-file-csharp
where: $
- transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupParameters BackupParameter');
+ transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupParameters BackupParameter');
- from: source-file-csharp
where: $
- transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRecoveryPoint Property');
+ transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRecoveryPoint Property');
```
## Alternate settings
diff --git a/src/DataProtection/check-dependencies.ps1 b/src/DataProtection/check-dependencies.ps1
index b02ae9135957..c29591c7bfe1 100644
--- a/src/DataProtection/check-dependencies.ps1
+++ b/src/DataProtection/check-dependencies.ps1
@@ -25,7 +25,7 @@ if(-not $Isolated) {
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
if($predicate) {
$module = Get-Module -ListAvailable -Name $moduleName
- if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
$null = New-Item -ItemType Directory -Force -Path $path
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
if ($requiredVersion) {
@@ -47,7 +47,7 @@ if(Test-Path -Path $localModulesPath) {
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
}
-DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3'
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
$tools = Join-Path $PSScriptRoot 'tools'
diff --git a/src/DataProtection/create-model-cmdlets.ps1 b/src/DataProtection/create-model-cmdlets.ps1
index 43f95460cf18..bf30b6b71fcb 100644
--- a/src/DataProtection/create-model-cmdlets.ps1
+++ b/src/DataProtection/create-model-cmdlets.ps1
@@ -23,7 +23,7 @@ function CreateModelCmdlet {
}
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
- $ModuleName = 'Az.DataProtection'.Split(".")[1]
+ $ModuleName = 'DataProtection'
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
$null = New-Item -ItemType Directory -Force -Path $OutputDir
@@ -115,7 +115,9 @@ function CreateModelCmdlet {
# check whether completer is needed
$completer = '';
if($Type.Split('.').Split('.')[-2] -eq 'Support') {
- $completer += "`n [ArgumentCompleter([${Type}])]"
+ # If Type is an array, need to strip []
+ $strippedType = $Type.Replace('[]', '')
+ $completer += "`n [ArgumentCompleter([${strippedType}])]"
}
$ParameterDefineScript = "
[Parameter($ParameterDefineProperty)]${completer}
diff --git a/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionBackupInstanceInAzGraph.ps1 b/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionBackupInstanceInAzGraph.ps1
index bd762a7a7595..b619013ffee3 100644
--- a/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionBackupInstanceInAzGraph.ps1
+++ b/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionBackupInstanceInAzGraph.ps1
@@ -55,7 +55,7 @@
foreach($argResponse in $argInstanceResponse)
{
$jsonStringResponse = $argResponse | ConvertTo-Json -Depth 100
- $backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource]::FromJsonString($jsonStringResponse)
+ $backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource]::FromJsonString($jsonStringResponse)
}
return $backupInstances
}
diff --git a/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionJobInAzGraph.ps1 b/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionJobInAzGraph.ps1
index 9960bda55904..6249438dc632 100644
--- a/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionJobInAzGraph.ps1
+++ b/src/DataProtection/custom/Cmdlets/Backupcenter/Search-AzDataProtectionJobInAzGraph.ps1
@@ -83,7 +83,7 @@
foreach($jobresponse in $argJobResponse)
{
$jsonStringResponse = $jobresponse | ConvertTo-Json -Depth 100
- $backupJobs += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
+ $backupJobs += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
}
return $backupJobs
}
diff --git a/src/DataProtection/custom/Cmdlets/Common/Initialize-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/custom/Cmdlets/Common/Initialize-AzDataProtectionBackupInstance.ps1
index 1fcb7cb92969..0ffe926a3395 100644
--- a/src/DataProtection/custom/Cmdlets/Common/Initialize-AzDataProtectionBackupInstance.ps1
+++ b/src/DataProtection/custom/Cmdlets/Common/Initialize-AzDataProtectionBackupInstance.ps1
@@ -2,7 +2,7 @@
function Initialize-AzDataProtectionBackupInstance {
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Initializes Backup instance Request object for configuring backup')]
@@ -38,7 +38,7 @@ function Initialize-AzDataProtectionBackupInstance {
process {
$manifest = LoadManifest -DatasourceType $DatasourceType.ToString()
- $backupInstance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstance]::new()
+ $backupInstance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstance]::new()
$backupInstance.ObjectType = "BackupInstance"
if($PSBoundParameters.ContainsKey("DatasourceId"))
@@ -73,9 +73,9 @@ function Initialize-AzDataProtectionBackupInstance {
$errormsg = "Please input SecretStoreType"
throw $errormsg
}
- $backupInstance.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreBasedAuthCredentials]::new()
+ $backupInstance.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreBasedAuthCredentials]::new()
$backupInstance.DatasourceAuthCredentials.ObjectType = "SecretStoreBasedAuthCredentials"
- $backupInstance.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreResource]::new()
+ $backupInstance.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreResource]::new()
$backupInstance.DatasourceAuthCredentials.SecretStoreResource.SecretStoreType = $SecretStoreType
$backupInstance.DatasourceAuthCredentials.SecretStoreResource.Uri = $SecretStoreURI
}
@@ -85,7 +85,7 @@ function Initialize-AzDataProtectionBackupInstance {
}
}
- $backupInstanceResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource]::new()
+ $backupInstanceResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource]::new()
$backupInstanceResource.Property = $backupInstance
if($PSBoundParameters.ContainsKey("DatasourceId"))
@@ -103,7 +103,7 @@ function Initialize-AzDataProtectionBackupInstance {
if($DatasourceType.ToString() -eq "AzureDisk")
{
- $operationalParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureOperationalStoreParameters]::new()
+ $operationalParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureOperationalStoreParameters]::new()
$operationalParam.DataStoreType = "OperationalStore"
$operationalParam.ObjectType = "AzureOperationalStoreParameters"
$operationalParam.ResourceGroupId = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}"
diff --git a/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionBackupInstance.ps1
index 323f83406681..87db63637be7 100644
--- a/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionBackupInstance.ps1
+++ b/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionBackupInstance.ps1
@@ -20,7 +20,7 @@ function New-AzDataProtectionBackupInstance {
${VaultName},
[Parameter(Mandatory, HelpMessage='Backup instance request object which will be used to configure backup')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource]
${BackupInstance},
[Parameter()]
diff --git a/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionResourceGuard.ps1 b/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionResourceGuard.ps1
new file mode 100644
index 000000000000..4c8fd80ec042
--- /dev/null
+++ b/src/DataProtection/custom/Cmdlets/Common/New-AzDataProtectionResourceGuard.ps1
@@ -0,0 +1,83 @@
+
+
+function New-AzDataProtectionResourceGuard
+{
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource')]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a resource guard under a resource group')]
+
+ param(
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory=$false, HelpMessage='Subscription Id of the resource guard')]
+ [System.String]
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory, HelpMessage='Resource Group name of the resource guard')]
+ [System.String]
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory, HelpMessage='Name of the resource guard')]
+ [System.String]
+ ${Name},
+
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory=$false, HelpMessage='Optional ETag')]
+ [System.String]
+ ${ETag},
+
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory=$false, HelpMessage='The IdentityType to be added to the resource guard, example: SystemAssigned, None')]
+ [System.String]
+ ${IdentityType},
+
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory, HelpMessage='Location of the resource guard')]
+ [System.String]
+ ${Location},
+
+ [Parameter(ParameterSetName="CreateResourceGuard", Mandatory=$false, HelpMessage='Resource tags')]
+ [Hashtable]
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process
+ {
+ Az.DataProtection.Internal\New-AzDataProtectionResourceGuard @PSBoundParameters
+ }
+}
\ No newline at end of file
diff --git a/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1 b/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1
index e72147818bec..6af664a269ff 100644
--- a/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1
+++ b/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1
@@ -2,7 +2,7 @@
function Update-AzDataProtectionBackupInstanceAssociatedPolicy
{
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates associated policy for a given backup instance')]
diff --git a/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionResourceGuard.ps1 b/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionResourceGuard.ps1
new file mode 100644
index 000000000000..4b69e82e8be8
--- /dev/null
+++ b/src/DataProtection/custom/Cmdlets/Common/Update-AzDataProtectionResourceGuard.ps1
@@ -0,0 +1,115 @@
+
+
+function Update-AzDataProtectionResourceGuard
+{
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource')]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates a resource guard belonging to a resource group')]
+
+ param(
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory=$false, HelpMessage='Subscription Id of the resource guard')]
+ [System.String]
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory, HelpMessage='Resource Group name of the resource guard')]
+ [System.String]
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory, HelpMessage='Name of the resource guard')]
+ [System.String]
+ ${Name},
+
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory=$false, HelpMessage='Optional ETag')]
+ [System.String]
+ ${ETag},
+
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory=$false, HelpMessage='The identityType to be updated in resource guard, example: SystemAssigned, None')]
+ [System.String]
+ ${IdentityType},
+
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory=$false, HelpMessage='Resource tags')]
+ [Hashtable]
+ ${Tag},
+
+ [Parameter(ParameterSetName="UpdateResourceGuardOperations", Mandatory=$false, HelpMessage='List of critical operations which are not protected by this resourceGuard. Supported values are DeleteProtection, UpdateProtection, UpdatePolicy, GetSecurityPin')]
+ [System.String[]]
+ ${CriticalOperationExclusionList},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process
+ {
+ $ResGuard = $null
+ if($SubscriptionId -ne $null){
+ $ResGuard = Get-AzDataProtectionResourceGuard -Name $Name -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId
+ }
+ else {
+ $ResGuard = Get-AzDataProtectionResourceGuard -Name $Name -ResourceGroupName $ResourceGroupName
+ }
+
+ # modify Critical operation exclusion list
+ $CriticalOperationsMap = @{ DeleteProtection = "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/delete"; UpdateProtection = "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/write"; UpdatePolicy = "Microsoft.RecoveryServices/vaults/backupPolicies/write"; GetSecurityPin = "Microsoft.RecoveryServices/vaults/backupSecurityPIN/action" }
+
+ $CriticalOperationExclusionListInternal = [System.Collections.ArrayList]@()
+
+ foreach($item in $CriticalOperationExclusionList)
+ {
+ if($CriticalOperationsMap.ContainsKey($item)){
+ $arrayIndex = $CriticalOperationExclusionListInternal.Add($CriticalOperationsMap[$item])
+ }
+ else {
+ $arrayIndex = $CriticalOperationExclusionListInternal.Add($item)
+ }
+ }
+
+ if($PSBoundParameters.ContainsKey("CriticalOperationExclusionList"))
+ {
+ $null = $PSBoundParameters.Remove("CriticalOperationExclusionList")
+ $null = $PSBoundParameters.Add("CriticalOperationExclusionList", $CriticalOperationExclusionListInternal)
+ }
+
+ # Add Location
+ $null = $PSBoundParameters.Add("Location", $ResGuard.Location)
+
+ Az.DataProtection.Internal\New-AzDataProtectionResourceGuard @PSBoundParameters
+ }
+}
\ No newline at end of file
diff --git a/src/DataProtection/custom/Cmdlets/Platform/Restore/Initialize-AzDataProtectionRestoreRequest.ps1 b/src/DataProtection/custom/Cmdlets/Platform/Restore/Initialize-AzDataProtectionRestoreRequest.ps1
index a68d9c8eefc8..d26732e04cb4 100644
--- a/src/DataProtection/custom/Cmdlets/Platform/Restore/Initialize-AzDataProtectionRestoreRequest.ps1
+++ b/src/DataProtection/custom/Cmdlets/Platform/Restore/Initialize-AzDataProtectionRestoreRequest.ps1
@@ -1,6 +1,6 @@
function Initialize-AzDataProtectionRestoreRequest
{
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Initializes Restore Request object for triggering restore on a protected backup instance.')]
@@ -71,7 +71,7 @@
[Parameter(ParameterSetName="OriginalLocationFullRecovery", Mandatory, HelpMessage='Backup Instance object to trigger original localtion restore.')]
[Parameter(ParameterSetName="OriginalLocationILR", Mandatory, HelpMessage='Backup Instance object to trigger original localtion restore.')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource]
${BackupInstance},
[Parameter(ParameterSetName="AlternateLocationFullRecovery", Mandatory, HelpMessage='Target resource Id to which backup data will be restored.')]
@@ -132,7 +132,7 @@
Write-Debug -Message $RecoveryPoint
if($PSBoundParameters.ContainsKey("RehydrationPriority")){
- $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRestoreWithRehydrationRequest]::new()
+ $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRestoreWithRehydrationRequest]::new()
$restoreRequest.ObjectType = "AzureBackupRestoreWithRehydrationRequest"
$restoreRequest.RehydrationPriority = $RehydrationPriority
if($PSBoundParameters.ContainsKey("RehydrationDuration")){
@@ -143,7 +143,7 @@
}
}
else{
- $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryPointBasedRestoreRequest]::new()
+ $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryPointBasedRestoreRequest]::new()
$restoreRequest.ObjectType = "AzureBackupRecoveryPointBasedRestoreRequest"
}
$restoreRequest.RecoveryPointId = $RecoveryPoint
@@ -153,7 +153,7 @@
{
$utcTime = $PointInTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
Write-Debug -Message $utcTime
- $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureBackupRecoveryTimeBasedRestoreRequest]::new()
+ $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureBackupRecoveryTimeBasedRestoreRequest]::new()
$restoreRequest.ObjectType = "AzureBackupRecoveryTimeBasedRestoreRequest"
$restoreRequest.RecoveryPointTime = $utcTime
$restoreMode = "PointInTimeBased"
@@ -170,7 +170,7 @@
if($RestoreType -eq "RestoreAsFiles")
{
- $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreFilesTargetInfo]::new()
+ $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreFilesTargetInfo]::new()
$restoreRequest.RestoreTargetInfo.ObjectType = "RestoreFilesTargetInfo"
if(!($PSBoundParameters.ContainsKey("FileNamePrefix")) -or !($PSBoundParameters.ContainsKey("TargetContainerURI")) ){
@@ -185,13 +185,13 @@
elseif(!($ItemLevelRecovery))
{
# RestoreTargetInfo for OLR ALR Full recovery
- $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RestoreTargetInfo]::new()
+ $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RestoreTargetInfo]::new()
$restoreRequest.RestoreTargetInfo.ObjectType = "restoreTargetInfo"
}
else
{
# ILR: ItemLevelRestoreTargetInfo
- $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ItemLevelRestoreTargetInfo]::new()
+ $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ItemLevelRestoreTargetInfo]::new()
$restoreRequest.RestoreTargetInfo.ObjectType = "itemLevelRestoreTargetInfo"
$restoreCriteriaList = @()
@@ -199,7 +199,7 @@
if($ContainersList.length -gt 0){
for($i = 0; $i -lt $ContainersList.length; $i++){
- $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RangeBasedItemLevelRestoreCriteria]::new()
+ $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RangeBasedItemLevelRestoreCriteria]::new()
$restoreCriteria.ObjectType = "RangeBasedItemLevelRestoreCriteria"
$restoreCriteria.MinMatchingValue = $ContainersList[$i]
@@ -218,7 +218,7 @@
for($i = 0; $i -lt $FromPrefixPattern.length; $i++){
- $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.RangeBasedItemLevelRestoreCriteria]::new()
+ $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.RangeBasedItemLevelRestoreCriteria]::new()
$restoreCriteria.ObjectType = "RangeBasedItemLevelRestoreCriteria"
$restoreCriteria.MinMatchingValue = $FromPrefixPattern[$i]
@@ -280,9 +280,9 @@
$errormsg = "Please input SecretStoreType"
throw $errormsg
}
- $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreBasedAuthCredentials]::new()
+ $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreBasedAuthCredentials]::new()
$restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.ObjectType = "SecretStoreBasedAuthCredentials"
- $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SecretStoreResource]::new()
+ $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SecretStoreResource]::new()
$restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource.SecretStoreType = $SecretStoreType
$restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource.Uri = $SecretStoreURI
}
diff --git a/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVault.ps1 b/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVault.ps1
index bbca20b7cda2..d5d618d113f1 100644
--- a/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVault.ps1
+++ b/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVault.ps1
@@ -30,9 +30,14 @@
${Location},
[Parameter(Mandatory, HelpMessage='Storage Settings of the vault. Use New-AzDataProtectionBackupVaultStorageSetting Cmdlet to Create.')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IStorageSetting[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IStorageSetting[]]
${StorageSetting},
+ [Parameter(Mandatory=$false, HelpMessage='Parameter to Enable or Disable built-in azure monitor alerts for job failures. Security alerts cannot be disabled.')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState]
+ [ValidateSet('Enabled','Disabled')]
+ ${AzureMonitorAlertsForAllJobFailure},
+
[Parameter(HelpMessage='Resource tags.')]
[System.Collections.Hashtable]
${Tag},
@@ -43,7 +48,7 @@
[System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},
-
+
[Parameter()]
[System.Management.Automation.SwitchParameter]
# Run the command as a job
diff --git a/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVaultStorageSettingObject.ps1 b/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVaultStorageSettingObject.ps1
index 11ec1a75ed82..22a266964175 100644
--- a/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVaultStorageSettingObject.ps1
+++ b/src/DataProtection/custom/Cmdlets/Platform/Vault/New-AzDataProtectionBackupVaultStorageSettingObject.ps1
@@ -15,7 +15,7 @@ function New-AzDataProtectionBackupVaultStorageSettingObject{
)
process {
- $storageSetting = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.StorageSetting]::new()
+ $storageSetting = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.StorageSetting]::new()
$storageSetting.Type = $Type
$storageSetting.DataStoreType = $DataStoreType
diff --git a/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 b/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1
index cef2959208f3..9fe86081eae3 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1
@@ -1,14 +1,14 @@

function Edit-AzDataProtectionPolicyRetentionRuleClientObject {
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Adds or removes Retention Rule to existing Policy')]
param(
[Parameter(ParameterSetName='AddRetention',Mandatory, HelpMessage='Backup Policy Object')]
[Parameter(ParameterSetName='RemoveRetention',Mandatory, HelpMessage='Backup Policy Object')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
${Policy},
[Parameter(ParameterSetName='AddRetention',Mandatory, HelpMessage='Retention Rule Name')]
@@ -25,7 +25,7 @@ function Edit-AzDataProtectionPolicyRetentionRuleClientObject {
${RemoveRule},
[Parameter(ParameterSetName='AddRetention',Mandatory, HelpMessage='Life cycles associated with the retention rule.')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle[]]
${LifeCycles}
)
@@ -64,7 +64,7 @@ function Edit-AzDataProtectionPolicyRetentionRuleClientObject {
throw "Selected Retention Rule " + $Name + " is not applicable for Datasource Type " + $clientDatasourceType
}
- $newRetentionRule = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.AzureRetentionRule]::new()
+ $newRetentionRule = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.AzureRetentionRule]::new()
$newRetentionRule.ObjectType = "AzureRetentionRule"
$newRetentionRule.IsDefault = $IsDefault
$newRetentionRule.Name = $Name
diff --git a/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTagClientObject.ps1 b/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTagClientObject.ps1
index 4f21b5e4192b..911d1eb77f99 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTagClientObject.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTagClientObject.ps1
@@ -1,12 +1,12 @@
function Edit-AzDataProtectionPolicyTagClientObject{
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Adds or removes schedule tag in an existing backup policy.')]
param(
[Parameter(ParameterSetName='updateTag', Mandatory, HelpMessage='Backup Policy Object.')]
[Parameter(ParameterSetName='RemoveTag', Mandatory, HelpMessage='Backup Policy Object.')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
${Policy},
[Parameter(ParameterSetName='updateTag', Mandatory, HelpMessage='Name of the Schedule tag.')]
@@ -19,7 +19,7 @@
${RemoveRule},
[Parameter(ParameterSetName='updateTag', Mandatory, HelpMessage='Criterias to be associated with the schedule tag.')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria[]]
${Criteria}
)
@@ -83,7 +83,7 @@
if($tagIndex -eq -1)
{
- $tagCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TaggingCriteria]::new()
+ $tagCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TaggingCriteria]::new()
$tagCriteria.TaggingPriority = GetTaggingPriority -Name $Name
$tagCriteria.Criterion = $Criteria
$tagCriteria.TagInfoTagName = $Name
diff --git a/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTriggerClientObject.ps1 b/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTriggerClientObject.ps1
index 927f0c07af87..fa64fb963a07 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTriggerClientObject.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/Edit-AzDataProtectionPolicyTriggerClientObject.ps1
@@ -1,11 +1,11 @@
function Edit-AzDataProtectionPolicyTriggerClientObject{
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates Backup schedule of an existing backup policy.')]
param (
[Parameter(Mandatory, HelpMessage='Backup Policy object.')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
${Policy},
[Parameter(Mandatory, HelpMessage='Schedule to be associated to backup policy.')]
diff --git a/src/DataProtection/custom/Cmdlets/Policy/Get-AzDataProtectionPolicyTemplate.ps1 b/src/DataProtection/custom/Cmdlets/Policy/Get-AzDataProtectionPolicyTemplate.ps1
index 559633fc41af..9259111e4224 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/Get-AzDataProtectionPolicyTemplate.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/Get-AzDataProtectionPolicyTemplate.ps1
@@ -1,7 +1,7 @@

function Get-AzDataProtectionPolicyTemplate {
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Gets default policy template for a selected datasource type.')]
@@ -17,7 +17,7 @@ function Get-AzDataProtectionPolicyTemplate {
$manifestPolicyObject = $manifest.policySettings.defaultPolicy
$jsonPolicyString = $manifestPolicyObject | ConvertTo-Json -Depth 100
- $defaultPolicy = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupPolicy]::FromJsonString($jsonPolicyString)
+ $defaultPolicy = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupPolicy]::FromJsonString($jsonPolicyString)
return $defaultPolicy
}
diff --git a/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionBackupPolicy.ps1 b/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionBackupPolicy.ps1
index f18e69b13f29..11ed6a1e2af4 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionBackupPolicy.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionBackupPolicy.ps1
@@ -1,7 +1,7 @@
function New-AzDataProtectionBackupPolicy
{
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a new backup policy in a given backup vault')]
@@ -23,7 +23,7 @@
${Name},
[Parameter(Mandatory, HelpMessage='Policy Request Object')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
${Policy},
[Parameter()]
@@ -114,7 +114,7 @@
$index += 1
}
- $policyObject = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BaseBackupPolicyResource]::new()
+ $policyObject = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BaseBackupPolicyResource]::new()
$policyObject.Property = $Policy
$null = $PSBoundParameters.Remove("Policy")
diff --git a/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1 b/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1
index a6d386a1b3fd..881d6fdce5c3 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1
@@ -1,5 +1,5 @@
function New-AzDataProtectionPolicyTagCriteriaClientObject{
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a new criteria object')]
@@ -32,7 +32,7 @@
)
process {
- $criteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ScheduleBasedBackupCriteria]::new()
+ $criteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ScheduleBasedBackupCriteria]::new()
$criteria.ObjectType = "ScheduleBasedBackupCriteria"
if($AbsoluteCriteria -ne $null){
$criteria.AbsoluteCriterion = $AbsoluteCriteria
@@ -61,7 +61,7 @@
{
throw "Day of month should be between 1 and 28."
}
- $day = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Day]::new()
+ $day = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Day]::new()
$day.Date = $dayOfMonthNumber
$day.IsLast = $false
$criteria.DaysOfMonth += $day
@@ -72,7 +72,7 @@
{
thow "Day of month should either be between 1 and 28 or it should be last"
}
- $day = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Day]::new()
+ $day = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Day]::new()
$day.IsLast = $true
$criteria.DaysOfMonth += $day
}
diff --git a/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionRetentionLifeCycleClientObject.ps1 b/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionRetentionLifeCycleClientObject.ps1
index 933402d4be55..5104fbcd303b 100644
--- a/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionRetentionLifeCycleClientObject.ps1
+++ b/src/DataProtection/custom/Cmdlets/Policy/New-AzDataProtectionRetentionLifeCycleClientObject.ps1
@@ -1,5 +1,5 @@
function New-AzDataProtectionRetentionLifeCycleClientObject {
- [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle')]
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates new Lifecycle object')]
@@ -26,7 +26,7 @@
)
process {
- $lifeCycle = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.SourceLifeCycle]::new()
+ $lifeCycle = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.SourceLifeCycle]::new()
$lifeCycle.SourceDataStoreObjectType = "DataStoreInfoBase"
$lifeCycle.SourceDataStoreType = $SourceDataStore
$lifeCycle.DeleteAfterObjectType = "AbsoluteDeleteOption"
@@ -34,7 +34,7 @@
if(($TargetDataStore -ne $null) -and ($CopyOption -ne $null))
{
- $targetCopySetting = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.TargetCopySetting]::new()
+ $targetCopySetting = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.TargetCopySetting]::new()
$targetCopySetting.DataStoreObjectType = "DataStoreInfoBase"
$targetCopySetting.DataStoreType = $TargetDataStore
$targetCopySetting.CopyAfterObjectType = $CopyOption
diff --git a/src/DataProtection/custom/Helpers/CommonHelpers.ps1 b/src/DataProtection/custom/Helpers/CommonHelpers.ps1
index 2f00e340f7a7..a744b6353cb7 100644
--- a/src/DataProtection/custom/Helpers/CommonHelpers.ps1
+++ b/src/DataProtection/custom/Helpers/CommonHelpers.ps1
@@ -5,13 +5,13 @@ function GetDatasourceSetInfo
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IDatasource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IDatasource]
$DatasourceInfo
)
process
{
- $DataSourceSetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.DatasourceSet]::new()
+ $DataSourceSetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.DatasourceSet]::new()
$DataSourceSetInfo.DatasourceType = $DatasourceInfo.Type
$DataSourceSetInfo.ObjectType = "DatasourceSet"
$splitResourceId = $DatasourceInfo.ResourceId.Split("/")
@@ -49,7 +49,7 @@ function GetDatasourceInfo
process
{
$manifest = LoadManifest -DatasourceType $DatasourceType.ToString()
- $DataSourceInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.Datasource]::new()
+ $DataSourceInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.Datasource]::new()
$DataSourceInfo.ObjectType = "Datasource"
$DataSourceInfo.ResourceId = $ResourceId
$DataSourceInfo.ResourceLocation = $ResourceLocation
diff --git a/src/DataProtection/custom/Models/BackupInstanceResource.cs b/src/DataProtection/custom/Models/BackupInstanceResource.cs
index 894d0430e065..4af4b331f359 100644
--- a/src/DataProtection/custom/Models/BackupInstanceResource.cs
+++ b/src/DataProtection/custom/Models/BackupInstanceResource.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
-namespace Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701
+namespace Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401
{
public partial class BackupInstanceResource
{
diff --git a/src/DataProtection/examples/Backup-AzDataProtectionBackupInstanceAdhoc.md b/src/DataProtection/examples/Backup-AzDataProtectionBackupInstanceAdhoc.md
index 4ee15e4929ac..c7b583424e7c 100644
--- a/src/DataProtection/examples/Backup-AzDataProtectionBackupInstanceAdhoc.md
+++ b/src/DataProtection/examples/Backup-AzDataProtectionBackupInstanceAdhoc.md
@@ -1,7 +1,7 @@
### Example 1: Backup a protected backup instance
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName "BackupWeekly" -TriggerOptionRetentionTagOverride "Default"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName "BackupWeekly" -TriggerOptionRetentionTagOverride "Default"
```
@@ -9,18 +9,17 @@ This Command Triggers Backup for a given backup instance.
### Example 2: Backup a protected backup instance
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -VaultName "MyVault" -ResourceGroupName "MyResourceGroup" | where {$_.Name -eq "policyName"}
-PS C:\> $backupJob = Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName $policy.Property.PolicyRule[0].Name -TriggerOptionRetentionTagOverride $policy.Property.PolicyRule[0].Trigger.TaggingCriterion[0].TagInfoTagName
-PS C:\> $jobid = $backupJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
->> {
->> Start-Sleep -Seconds 10
->> $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId $sub -ResourceGroupName $rgName -VaultName $vaultName
->> $jobstatus = $currentjob.Status
->> }
-
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -VaultName "MyVault" -ResourceGroupName "MyResourceGroup" | Where-Object {$_.Name -eq "policyName"}
+$backupJob = Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName $policy.Property.PolicyRule[0].Name -TriggerOptionRetentionTagOverride $policy.Property.PolicyRule[0].Trigger.TaggingCriterion[0].TagInfoTagName
+$jobid = $backupJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
+{
+ Start-Sleep -Seconds 10
+ $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId $sub -ResourceGroupName $rgName -VaultName $vaultName
+ $jobstatus = $currentjob.Status
+}
```
This Command Triggers Backup for a given backup instance using protection policy used to protect the backup instance. Then we track the backup job in a loop until it's completed.
diff --git a/src/DataProtection/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md b/src/DataProtection/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md
index 983a5b3e736f..22da1c5c9a79 100644
--- a/src/DataProtection/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md
+++ b/src/DataProtection/examples/Edit-AzDataProtectionPolicyRetentionRuleClientObject.md
@@ -1,9 +1,11 @@
### Example 1: Add Weekly Retention Rule
```powershell
-PS C:\> $pol = Get-AzDataProtectionPolicyTemplate
-PS C:\> $lifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 5
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -LifeCycles $lifecycle -IsDefault $false
+$pol = Get-AzDataProtectionPolicyTemplate
+$lifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 5
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -LifeCycles $lifecycle -IsDefault $false
+```
+```output
DatasourceType ObjectType
-------------- ----------
{Microsoft.Compute/disks} BackupPolicy
@@ -13,8 +15,10 @@ The first command gets the default policy template. The second command creates a
### Example 2: Remove Weekly Retention Rule
```powershell
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -RemoveRule
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -RemoveRule
+```
+```output
DatasourceType ObjectType
-------------- ----------
{Microsoft.Compute/disks} BackupPolicy
diff --git a/src/DataProtection/examples/Edit-AzDataProtectionPolicyTagClientObject.md b/src/DataProtection/examples/Edit-AzDataProtectionPolicyTagClientObject.md
index e0b3ddd8be4a..190a479cc476 100644
--- a/src/DataProtection/examples/Edit-AzDataProtectionPolicyTagClientObject.md
+++ b/src/DataProtection/examples/Edit-AzDataProtectionPolicyTagClientObject.md
@@ -1,8 +1,10 @@
### Example 1: Add Weekly tag to Backup Policy
```powershell
-PS C:\> $criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
+$criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
+Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
+```
+```output
DatasourceType ObjectType
-------------- ----------
{Microsoft.Compute/disks} BackupPolicy
@@ -12,8 +14,10 @@ This command adds a weekly tag to given backup policy
### Example 2: Remove Weeky tag from Backup Policy
```powershell
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
+Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
+```
+```output
DatasourceType ObjectType
-------------- ----------
{Microsoft.Compute/disks} BackupPolicy
diff --git a/src/DataProtection/examples/Edit-AzDataProtectionPolicyTriggerClientObject.md b/src/DataProtection/examples/Edit-AzDataProtectionPolicyTriggerClientObject.md
index a99b95c7d046..368c794d8a4a 100644
--- a/src/DataProtection/examples/Edit-AzDataProtectionPolicyTriggerClientObject.md
+++ b/src/DataProtection/examples/Edit-AzDataProtectionPolicyTriggerClientObject.md
@@ -1,8 +1,10 @@
### Example 1: Add Daily schedule to Azure Backup rule.
```powershell
-PS C:\> $schedule = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays (get-date) -IntervalType Daily -IntervalCount 1
-PS C:\> Edit-AzDataProtectionPolicyTriggerClientObject -Policy $pol -Schedule $schedule
+$schedule = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays (Get-Date) -IntervalType Daily -IntervalCount 1
+Edit-AzDataProtectionPolicyTriggerClientObject -Policy $pol -Schedule $schedule
+```
+```output
DatasourceType ObjectType
-------------- ----------
{Microsoft.Compute/disks} BackupPolicy
diff --git a/src/DataProtection/examples/Find-AzDataProtectionRestorableTimeRange.md b/src/DataProtection/examples/Find-AzDataProtectionRestorableTimeRange.md
index bd502210fd29..4cb9d4e45cec 100644
--- a/src/DataProtection/examples/Find-AzDataProtectionRestorableTimeRange.md
+++ b/src/DataProtection/examples/Find-AzDataProtectionRestorableTimeRange.md
@@ -1,11 +1,13 @@
### Example 1: Fetch valid restorable time ranges for a BackupInstance
```powershell
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $pointInTimeRange.RestorableTimeRange | fl
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$pointInTimeRange.RestorableTimeRange | Format-List
+```
+```output
EndTime : 2021-04-24T08:57:36.4149422Z
ObjectType : RestorableTimeRange
StartTime : 2021-03-25T14:27:31.0000000Z
diff --git a/src/DataProtection/examples/Get-AzDataProtectionBackupInstance.md b/src/DataProtection/examples/Get-AzDataProtectionBackupInstance.md
index 005efaaaf898..456a84884e02 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionBackupInstance.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionBackupInstance.md
@@ -1,23 +1,26 @@
### Example 1: Get all the backup instances protected in a specified backup vault.
```powershell
-PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f…
-sarathdisk2-sarathdisk2-74b127dc-7bf0-48ef-bcef-dab186cc6f10 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-74b127dc-7bf0-48ef-bcef-dab186c…
-
+sarathdisk-sarathdisk-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+sarathdisk2-sarathdisk2-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxcc Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
This command gets all the backup instances in a vault.
### Example 2: Get a backup instance by name.
```powershell
-PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "BackupInstanceName"
+PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "BackupInstanceName"
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166
+sarathdisk-sarathdisk-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
This command gets a specific backup instance protected in a backup vault.
diff --git a/src/DataProtection/examples/Get-AzDataProtectionBackupPolicy.md b/src/DataProtection/examples/Get-AzDataProtectionBackupPolicy.md
index ca2d4ac15e78..429f57288a5c 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionBackupPolicy.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionBackupPolicy.md
@@ -1,7 +1,9 @@
### Example 1: Get all backup policies in a backup vault.
```powershell
-PS C:\> Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+```
+```output
Name Type
---- ----
DiskPolicy1 Microsoft.DataProtection/backupVaults/backupPolicies
@@ -12,8 +14,10 @@ This command gets backup policies created in a given backup vault.
### Example 2: Get backup policy by Name
```powershell
-PS C:\> Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "MyPolicy"
+Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "MyPolicy"
+```
+```output
Name Type
---- ----
MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
diff --git a/src/DataProtection/examples/Get-AzDataProtectionBackupVault.md b/src/DataProtection/examples/Get-AzDataProtectionBackupVault.md
index cdc653857a4c..6351f6e3082e 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionBackupVault.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionBackupVault.md
@@ -1,36 +1,42 @@
### Example 1: Get all backup vaults in a given subscription
```powershell
-PS C:\> Get-AzDataProtectionBackupVault
+Get-AzDataProtectionBackupVault
+```
+```output
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
---- ------------------- ---------------- ------------ -------- ---- ----
- 2a21f108-07bc-4c22-a221-f26c9de554ba 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned westus adigupt-backupcenter-ga-Vault Microsoft.DataProtection/backupV…
- 34237b3f-8f2c-4ae7-bbff-2896491976fb 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned westcentralus BC-Usability-Vault-WCUS Microsoft.DataProtection/backupV…
- 41155247-420f-4052-a894-84814f0b983c 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap NilayBackupVault Microsoft.DataProtection/backupV…
- 26da260b-e232-419c-8586-9157e4f6260e 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap dpprunnervaultus Microsoft.DataProtection/backupV…
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned westus adigupt-backupcenter-ga-Vault Microsoft.DataProtection/backupVault
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned westcentralus BC-Usability-Vault-WCUS Microsoft.DataProtection/backupVault
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned centraluseuap NilayBackupVault Microsoft.DataProtection/backupVault
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned centraluseuap dpprunnervaultus Microsoft.DataProtection/backupVault
```
This command gets all backup vaults in current subscription context. Provide SubscriptionId parameter to retrieve backup vaults in a different subscription.
### Example 2: Get all backup vaults in a given resource Group.
```powershell
-PS C:\> Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg
+Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg
+```
+```output
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
---- ------------------- ---------------- ------------ -------- ---- ----
- 05400379-2551-4dc9-86e0-cf59ab05405a 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-dppvault Microsoft.DataProtection/backupVaults
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned centraluseuap sarath-dppvault Microsoft.DataProtection/backupVaults
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
```
This command gets all backup vaults in a given resource group.
### Example 3: Get a specific vault.
```powershell
-PS C:\> Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+```
+```output
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
---- ------------------- ---------------- ------------ -------- ---- ----
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
```
This command gets a specific vault by given vault name.
diff --git a/src/DataProtection/examples/Get-AzDataProtectionJob.md b/src/DataProtection/examples/Get-AzDataProtectionJob.md
index f0ee75db9dda..c2519c7072a4 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionJob.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionJob.md
@@ -1,7 +1,9 @@
### Example 1: Get All backup Jobs in a backup vault
```powershell
-PS C:\> Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+```
+```output
Name Type
---- ----
a6a4879d-f914-4174-b129-0e27da8a4fb0 Microsoft.DataProtection/backupVaults/backupJobs
@@ -16,8 +18,10 @@ This command gets all the backup jobs in a given backup vault.
### Example 2: Get a single Job
```powershell
-PS C:\> Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Id 4abaea8c-f53a-4bb1-9963-59f96b597165
+Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Id 4abaea8c-f53a-4bb1-9963-59f96b597165
+```
+```output
Name Type
---- ----
4abaea8c-f53a-4bb1-9963-59f96b597165 Microsoft.DataProtection/backupVaults/backupJobs
diff --git a/src/DataProtection/examples/Get-AzDataProtectionOperation.md b/src/DataProtection/examples/Get-AzDataProtectionOperation.md
index dd5d1b0ccfdc..a0781065b27e 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionOperation.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionOperation.md
@@ -1,7 +1,9 @@
### Example 1: Get the list of of available operations
```powershell
-PS C:\> Get-AzDataProtectionOperation
+Get-AzDataProtectionOperation
+```
+```output
IsDataAction Name Origin
------------ ---- ------
Microsoft.DataProtection/locations/getBackupStatus/action user
diff --git a/src/DataProtection/examples/Get-AzDataProtectionPolicyTemplate.md b/src/DataProtection/examples/Get-AzDataProtectionPolicyTemplate.md
index 1e6378071a1d..2c2558a3003f 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionPolicyTemplate.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionPolicyTemplate.md
@@ -1,7 +1,9 @@
### Example 1: Get Azure Disk default policy template
```powershell
-PS C:\> Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
+Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
+```
+```output
DatasourceType ObjectType
-------------- ----------
{Microsoft.Compute/disks} BackupPolicy
diff --git a/src/DataProtection/examples/Get-AzDataProtectionRecoveryPoint.md b/src/DataProtection/examples/Get-AzDataProtectionRecoveryPoint.md
index 56fa55e5f5f1..5cf83dfa6fa6 100644
--- a/src/DataProtection/examples/Get-AzDataProtectionRecoveryPoint.md
+++ b/src/DataProtection/examples/Get-AzDataProtectionRecoveryPoint.md
@@ -1,8 +1,10 @@
### Example 1: Get all recovery points of a given backup instance
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name
+```
+```output
Name Type
---- ----
aded40a562134f97b732f30d0b486fef Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
@@ -17,9 +19,11 @@ This command lists all available recovery points of a given backup instance
### Example 2: Get recovery point with given recovery point id.
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name -Id 892e5c5014dc4a96807d22924f5745c9
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name -Id 892e5c5014dc4a96807d22924f5745c9
+```
+```output
Name Type
---- ----
892e5c5014dc4a96807d22924f5745c9 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
diff --git a/src/DataProtection/examples/Get-AzDataProtectionResourceGuard.md b/src/DataProtection/examples/Get-AzDataProtectionResourceGuard.md
new file mode 100644
index 000000000000..763afb9ae71c
--- /dev/null
+++ b/src/DataProtection/examples/Get-AzDataProtectionResourceGuard.md
@@ -0,0 +1,31 @@
+### Example 1: Fetch a resource guard with a particular Name
+```powershell
+PS C:\> $resGuard = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "RGName" -Name "ResourceGuardName"
+PS C:\> $resGuard
+```
+
+```output
+ETag Id IdentityPrincipalId IdentityTenantId IdentityType Location Name
+---- -- ------------------- ---------------- ------------ -------- ----
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RGName/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardName centraluseuap ResourceGuardName
+```
+
+Gets a resource guard under a resource group with name "ResourceGuardName"
+
+### Example 2: Fetch all the resource guards under a resource group
+```powershell
+PS C:\> $resGuardList = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "RGName"
+PS C:\> $resGuardList
+```
+
+```output
+ETag Id IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
+---- -- ------------------- ---------------- ------------ -------- ---- ----
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/RGName/providers/Microsoft.DataProtection/resourceGuards/rguard1 centraluseuap rguard1 Microsoft.DataProtection/resourceGuards
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/RGName/providers/Microsoft.DataProtection/resourceGuards/rguard2 centraluseuap rguard2 Microsoft.DataProtection/resourceGuards
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RGName/providers/Microsoft.DataProtection/resourceGuards/rguard3 centraluseuap rguard3 Microsoft.DataProtection/resourceGuards
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RGName/providers/Microsoft.DataProtection/resourceGuards/rguard4 centraluseuap rguard4 Microsoft.DataProtection/resourceGuards
+```
+
+Gets all resource guards under a resource group
+
diff --git a/src/DataProtection/examples/Initialize-AzDataProtectionBackupInstance.md b/src/DataProtection/examples/Initialize-AzDataProtectionBackupInstance.md
index 815d5b53323d..43fd584e2015 100644
--- a/src/DataProtection/examples/Initialize-AzDataProtectionBackupInstance.md
+++ b/src/DataProtection/examples/Initialize-AzDataProtectionBackupInstance.md
@@ -1,11 +1,13 @@
### Example 1: Get Backup instance object for Azure Disk
```powershell
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> $AzureDiskId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{diskname}"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation westus -DatasourceId $AzureDiskId -PolicyId $policy[0].Id
-PS C:\> $instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{snapshotResourceGroup}"
-PS C:\> $instance
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+$AzureDiskId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{diskname}"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation westus -DatasourceId $AzureDiskId -PolicyId $policy[0].Id
+$instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{snapshotResourceGroup}"
+$instance
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
sarath-disk3-sarath-disk3-af697a80-e2bc-49f1-af6c-22f6c4d68405
diff --git a/src/DataProtection/examples/Initialize-AzDataProtectionRestoreRequest.md b/src/DataProtection/examples/Initialize-AzDataProtectionRestoreRequest.md
index dc6bbc3a49db..febfc64abb64 100644
--- a/src/DataProtection/examples/Initialize-AzDataProtectionRestoreRequest.md
+++ b/src/DataProtection/examples/Initialize-AzDataProtectionRestoreRequest.md
@@ -1,10 +1,12 @@
### Example 1: Get restore request object for Protected Azure Disk Backup instance
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint "892e5c5014dc4a96807d22924f5745c9"
-PS C:\> $restoreRequest
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint "892e5c5014dc4a96807d22924f5745c9"
+$restoreRequest
+```
+```output
ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointI
d
---------- --------------------------- ------------------------------- -------------------------------- ------------------- --------------
@@ -15,13 +17,15 @@ This command initialized a restore request object which can be used to trigger r
### Example 2: Get restore request object for Protected Azure Blob Backup instance
```powershell
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instance[0] -PointInTime (Get-Date -Date $pointInTimeRange.RestorableTimeRange.EndTime)
-PS C:\> $restoreRequest
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instance[0] -PointInTime (Get-Date -Date $pointInTimeRange.RestorableTimeRange.EndTime)
+$restoreRequest
+```
+```output
ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
---------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
AzureBackupRecoveryTimeBasedRestoreRequest restoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-24T13:32:41.7018481Z
@@ -33,13 +37,15 @@ This command initialized a restore request object which can be used to trigger r
### Example 3: Get restore request object for Item Level recovery for containers under protected AzureBlob Backup instance
```powershell
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -ContainersList "containerName1","containerName2"
-PS C:\> $restoreRequest
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -ContainersList "containerName1","containerName2"
+$restoreRequest
+```
+```output
ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
---------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
AzureBackupRecoveryTimeBasedRestoreRequest itemLevelRestoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-23T02:47:02.9500000Z
@@ -51,13 +57,15 @@ This command initialized a restore request object which can be used to trigger I
### Example 4: Get restore request object for Item Level recovery for containers/prefixMatch under protected AzureBlob Backup instance
```powershell
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -FromPrefixPattern "container1/aaa","container1/ccc", "container2/aab", "container3" -ToPrefixPattern "container1/bbb","container1/ddd", "container2/abc", "container3-0"
-PS C:\> $restoreRequest
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -FromPrefixPattern "container1/aaa","container1/ccc", "container2/aab", "container3" -ToPrefixPattern "container1/bbb","container1/ddd", "container2/abc", "container3-0"
+$restoreRequest
+```
+```output
ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
---------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
AzureBackupRecoveryTimeBasedRestoreRequest itemLevelRestoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-23T02:47:02.9500000Z
diff --git a/src/DataProtection/examples/New-AzDataProtectionBackupInstance.md b/src/DataProtection/examples/New-AzDataProtectionBackupInstance.md
index 9d7490913594..1cf32674363f 100644
--- a/src/DataProtection/examples/New-AzDataProtectionBackupInstance.md
+++ b/src/DataProtection/examples/New-AzDataProtectionBackupInstance.md
@@ -1,13 +1,14 @@
### Example 1: Configure backup of an azure disk in a backup vault.
```powershell
-PS C:\> $sub = "xxxx-xxx-xx"
-PS C:\> $DiskId = "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{diskname}"
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $DiskId
-PS C:\> $instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}"
-PS C:\> New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstance $instance
-
+$sub = "xxxx-xxx-xx"
+$DiskId = "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{diskname}"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $DiskId
+$instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}"
+New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstance $instance
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166
@@ -18,14 +19,16 @@ The fourth command initializes the backup instance request. The last command con
### Example 2: Configure protection for AzureDatabaseForPostgreSQL database in a backup vault (using secret store authentication).
```powershell
-PS C:\> $sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
-PS C:\> $dataSourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/OssServerName/databases/DBName"
-PS C:\> $secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
-PS C:\> $vault = Get-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName $vaultName
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -Name "MyPolicy"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDatabaseForPostgreSQL -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $dataSourceId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
-PS C:\> New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -BackupInstance $instance
+$sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
+$dataSourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/OssServerName/databases/DBName"
+$secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
+$vault = Get-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName $vaultName
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -Name "MyPolicy"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDatabaseForPostgreSQL -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $dataSourceId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
+New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -BackupInstance $instance
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
xyz-postgresql-wus-empdb10-xxxxxxxx-xxxx-xxxx-a3ba-be75108d8b21 Microsoft.DataProtection/backupVaults/backupInstances xyz-postgresql-wus-empdb10-xxxxxxxx-xxxx-xxxx-a3ba-be75108d8b21
diff --git a/src/DataProtection/examples/New-AzDataProtectionBackupPolicy.md b/src/DataProtection/examples/New-AzDataProtectionBackupPolicy.md
index 8a81bf370eb7..043e69e36f74 100644
--- a/src/DataProtection/examples/New-AzDataProtectionBackupPolicy.md
+++ b/src/DataProtection/examples/New-AzDataProtectionBackupPolicy.md
@@ -1,8 +1,10 @@
### Example 1: Create a default policy
```powershell
-PS C:\> $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
-PS C:\> New-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy" -Policy $defaultPol
+$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
+New-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy" -Policy $defaultPol
+```
+```output
Name Type
---- ----
MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
@@ -12,11 +14,11 @@ This command creates a default policy for Azure disk datasource type.
### Example 2: Create a policy for AzureDatabaseForPostgreSQL, this example covers a sophisticated policy using powerShell
```powershell
-PS C:\> $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL
-PS C:\> $lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 3 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
-PS C:\> $lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $true
-PS C:\> $schDates = @(
+$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL
+$lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 3 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
+$lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $true
+$schDates = @(
(
(Get-Date -Year 2021 -Month 08 -Day 18 -Hour 10 -Minute 0 -Second 0)
),
@@ -24,16 +26,17 @@ PS C:\> $schDates = @(
(Get-Date -Year 2021 -Month 08 -Day 22 -Hour 10 -Minute 0 -Second 0)
))
-PS C:\> $trigger = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $schDates -IntervalType Weekly -IntervalCount 1
-PS C:\> Edit-AzDataProtectionPolicyTriggerClientObject -Schedule $trigger -Policy $defaultPol
-PS C:\> $lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
-PS C:\> $lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 12
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Monthly -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $false
-PS C:\> $tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfMonth
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $defaultPol -Name Monthly -Criteria $tagCriteria
-PS C:\> New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "MyPolicy" -Policy $defaultPol
-
+$trigger = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $schDates -IntervalType Weekly -IntervalCount 1
+Edit-AzDataProtectionPolicyTriggerClientObject -Schedule $trigger -Policy $defaultPol
+$lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
+$lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 12
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Monthly -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $false
+$tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfMonth
+Edit-AzDataProtectionPolicyTagClientObject -Policy $defaultPol -Name Monthly -Criteria $tagCriteria
+New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "MyPolicy" -Policy $defaultPol
+```
+```output
Name Type
---- ----
MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
diff --git a/src/DataProtection/examples/New-AzDataProtectionBackupVault.md b/src/DataProtection/examples/New-AzDataProtectionBackupVault.md
index 34ba0358da5f..972b89437162 100644
--- a/src/DataProtection/examples/New-AzDataProtectionBackupVault.md
+++ b/src/DataProtection/examples/New-AzDataProtectionBackupVault.md
@@ -1,9 +1,11 @@
### Example 1: Create a new backup vault
```powershell
-PS C:\> $sub = "xxxx-xxxx-xxxxx"
-PS C:\> $storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
-PS C:\> New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus
+$sub = "xxxx-xxxx-xxxxx"
+$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
+New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus
+```
+```output
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
---- ------------------- ---------------- ------------ -------- ---- ----
westus MyVault Microsoft.DataProtection/backupVaults
@@ -11,4 +13,3 @@ ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
This command creates a new backup vault.
-
diff --git a/src/DataProtection/examples/New-AzDataProtectionBackupVaultStorageSettingObject.md b/src/DataProtection/examples/New-AzDataProtectionBackupVaultStorageSettingObject.md
index 2ef6821faf5a..680427234f24 100644
--- a/src/DataProtection/examples/New-AzDataProtectionBackupVaultStorageSettingObject.md
+++ b/src/DataProtection/examples/New-AzDataProtectionBackupVaultStorageSettingObject.md
@@ -1,7 +1,9 @@
### Example 1: Create a new vault storage setting object
```powershell
-PS C:\> New-AzDataProtectionBackupVaultStorageSettingObject -Type GeoRedundant -DataStoreType VaultStore
+New-AzDataProtectionBackupVaultStorageSettingObject -Type GeoRedundant -DataStoreType VaultStore
+```
+```output
DatastoreType Type
------------- ----
VaultStore GeoRedundant
diff --git a/src/DataProtection/examples/New-AzDataProtectionPolicyTagCriteriaClientObject.md b/src/DataProtection/examples/New-AzDataProtectionPolicyTagCriteriaClientObject.md
index 8da298bfcc34..3b4eec447442 100644
--- a/src/DataProtection/examples/New-AzDataProtectionPolicyTagCriteriaClientObject.md
+++ b/src/DataProtection/examples/New-AzDataProtectionPolicyTagCriteriaClientObject.md
@@ -1,7 +1,9 @@
### Example 1: Create a tag with absolute criteria
```powershell
-PS C:\> New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfDay
+New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfDay
+```
+```output
ObjectType AbsoluteCriterion DaysOfTheWeek MonthsOfYear ScheduleTime WeeksOfTheMonth
---------- ----------------- ------------- ------------ ------------ ---------------
ScheduleBasedBackupCriteria {FirstOfDay}
@@ -11,8 +13,10 @@ This command creates a criteria object with absolute criteria.
### Example 2: create a tag with weekly criteria
```powershell
-PS C:\> New-AzDataProtectionPolicyTagCriteriaClientObject -DaysOfWeek @("Sunday", "Monday")
+New-AzDataProtectionPolicyTagCriteriaClientObject -DaysOfWeek @("Sunday", "Monday")
+```
+```output
ObjectType AbsoluteCriterion DaysOfTheWeek MonthsOfYear ScheduleTime WeeksOfTheMonth
---------- ----------------- ------------- ------------ ------------ ---------------
ScheduleBasedBackupCriteria {Sunday, Monday}
diff --git a/src/DataProtection/examples/New-AzDataProtectionPolicyTriggerScheduleClientObject.md b/src/DataProtection/examples/New-AzDataProtectionPolicyTriggerScheduleClientObject.md
index 9b44f631c9c3..a61e9226b6f2 100644
--- a/src/DataProtection/examples/New-AzDataProtectionPolicyTriggerScheduleClientObject.md
+++ b/src/DataProtection/examples/New-AzDataProtectionPolicyTriggerScheduleClientObject.md
@@ -1,8 +1,10 @@
### Example 1: Create a daily schedule object
```powershell
-PS C:\> $date = get-date
-PS C:\> New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Daily -IntervalCount 1
+$date = Get-Date
+New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Daily -IntervalCount 1
+```
+```output
R/2021-03-03T12:49:55+05:30/P1D
```
@@ -10,9 +12,11 @@ This command creates a daily schedule for Azure Backup Rule
### Example 2: Create an hourly schedule object
```powershell
-PS C:\> $date = get-date
-PS C:\> New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Hourly -IntervalCount 4
+$date = Get-Date
+New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Hourly -IntervalCount 4
+```
+```output
R/2021-03-03T12:49:55+05:30/PT4H
```
diff --git a/src/DataProtection/examples/New-AzDataProtectionResourceGuard.md b/src/DataProtection/examples/New-AzDataProtectionResourceGuard.md
new file mode 100644
index 000000000000..4b424640e797
--- /dev/null
+++ b/src/DataProtection/examples/New-AzDataProtectionResourceGuard.md
@@ -0,0 +1,13 @@
+### Example 1: Create a new resource guard
+```powershell
+PS C:\> New-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "mua-rg" -Name "mua-resource-guard" -Location "centraluseuap"
+```
+
+```output
+ETag Id IdentityPrincipalId IdentityTenantId IdentityType Location Name
+---- -- ------------------- ---------------- ------------ -------- ----
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/mua-rg/providers/Microsoft.DataProtection/resourceGuards/mua-resource-guard centraluseuap mua-resource-guard
+```
+
+The above command is used to create a resource guard "mua-resource-guard" under resource group "mua-rg" in location "centraluseuap"
+
diff --git a/src/DataProtection/examples/New-AzDataProtectionRetentionLifeCycleClientObject.md b/src/DataProtection/examples/New-AzDataProtectionRetentionLifeCycleClientObject.md
index 64274d0ffbff..e7823988662e 100644
--- a/src/DataProtection/examples/New-AzDataProtectionRetentionLifeCycleClientObject.md
+++ b/src/DataProtection/examples/New-AzDataProtectionRetentionLifeCycleClientObject.md
@@ -1,7 +1,9 @@
### Example 1: Create a daily retention lifecycle
```powershell
-PS C:\> New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30
+New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30
+```
+```output
DeleteAfterDuration : P30D
DeleteAfterObjectType : AbsoluteDeleteOption
SourceDataStoreObjectType : DataStoreInfoBase
@@ -13,8 +15,10 @@ This command creates a lifecycle object which stores the backup data in operatio
### Example 2: Create a weekly retention lifecycle.
```powershell
-PS C:\> New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 20
+New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 20
+```
+```output
DeleteAfterDuration : P20W
DeleteAfterObjectType : AbsoluteDeleteOption
SourceDataStoreObjectType : DataStoreInfoBase
diff --git a/src/DataProtection/examples/Remove-AzDataProtectionBackupInstance.md b/src/DataProtection/examples/Remove-AzDataProtectionBackupInstance.md
index 26edd1c92d18..a006623756a3 100644
--- a/src/DataProtection/examples/Remove-AzDataProtectionBackupInstance.md
+++ b/src/DataProtection/examples/Remove-AzDataProtectionBackupInstance.md
@@ -1,7 +1,7 @@
### Example 1: Delete a protected backup instance
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Remove-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name $instance[0].name
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name $instance[0].name
```
diff --git a/src/DataProtection/examples/Remove-AzDataProtectionBackupPolicy.md b/src/DataProtection/examples/Remove-AzDataProtectionBackupPolicy.md
index f25c04c2375a..3a2a6fbebc8b 100644
--- a/src/DataProtection/examples/Remove-AzDataProtectionBackupPolicy.md
+++ b/src/DataProtection/examples/Remove-AzDataProtectionBackupPolicy.md
@@ -1,7 +1,7 @@
### Example 1: Delete an existing policy
```powershell
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Remove-AzDataProtectionBackupPolicy -Name $policy[0].name -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupPolicy -Name $policy[0].name -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
```
diff --git a/src/DataProtection/examples/Remove-AzDataProtectionBackupVault.md b/src/DataProtection/examples/Remove-AzDataProtectionBackupVault.md
index 2f1758f80647..c8aac092a044 100644
--- a/src/DataProtection/examples/Remove-AzDataProtectionBackupVault.md
+++ b/src/DataProtection/examples/Remove-AzDataProtectionBackupVault.md
@@ -1,6 +1,6 @@
### Example 1: Delete a backup vault.
```powershell
-PS C:\> Remove-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
```
diff --git a/src/DataProtection/examples/Remove-AzDataProtectionResourceGuard.md b/src/DataProtection/examples/Remove-AzDataProtectionResourceGuard.md
new file mode 100644
index 000000000000..e578b0d49608
--- /dev/null
+++ b/src/DataProtection/examples/Remove-AzDataProtectionResourceGuard.md
@@ -0,0 +1,6 @@
+### Example 1: Delete a resource guard
+```powershell
+PS C:\> Remove-AzDataProtectionResourceGuard -Name "ResourceGuardName" -ResourceGroupName "ResourceGroupName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx"
+```
+This command is used to delete the resource guard under a resource group.
+
diff --git a/src/DataProtection/examples/Resume-AzDataProtectionBackupInstanceProtection.md b/src/DataProtection/examples/Resume-AzDataProtectionBackupInstanceProtection.md
new file mode 100644
index 000000000000..c5842ac66eeb
--- /dev/null
+++ b/src/DataProtection/examples/Resume-AzDataProtectionBackupInstanceProtection.md
@@ -0,0 +1,7 @@
+### Example 1: Resume protection for a backup instance for which the protection state is ProtectionStopped
+```powershell
+PS C:\> Resume-AzDataProtectionBackupInstanceProtection -BackupInstanceName $backupInstance.BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName"
+```
+
+ The above command can be used to resume protection for a stopped or suspended backup instance
+
diff --git a/src/DataProtection/examples/Search-AzDataProtectionBackupInstanceInAzGraph.md b/src/DataProtection/examples/Search-AzDataProtectionBackupInstanceInAzGraph.md
index 8440458c32c0..a00162c0e524 100644
--- a/src/DataProtection/examples/Search-AzDataProtectionBackupInstanceInAzGraph.md
+++ b/src/DataProtection/examples/Search-AzDataProtectionBackupInstanceInAzGraph.md
@@ -1,7 +1,9 @@
### Example 1: Get all protected azure disk backup instance in a given subscription
```powershell
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk
+```
+```output
Name Type
---- ----
ContosoDemoVM_DataDisk_0-ContosoDemoVM_DataDisk_0-5f7b2a1f-f1ab-4abe-aadf-e7dc48238157 microsoft.dataprotection/backupvaults/backupinstance
@@ -18,8 +20,10 @@ This command gets all protected azure disk backup instance in a given subscripti
### Example 2: Get all protected azure disk backup instance in a given resource group list
```powershell
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2")
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2")
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea74df26d4a8 microsoft.dataprotection/backupvaults/backupinstances sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea7
@@ -31,8 +35,10 @@ This commands gets all protected azure disk backup instance in a given set of re
### Example 3: Get all protected azure disk backup instance in a given resource group list with protection state 'ProtectionConfigured'
```powershell
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2") -ProtectionStatus ProtectionConfigured
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2") -ProtectionStatus ProtectionConfigured
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea74df26d4a8 microsoft.dataprotection/backupvaults/backupinstances sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea7
diff --git a/src/DataProtection/examples/Search-AzDataProtectionJobInAzGraph.md b/src/DataProtection/examples/Search-AzDataProtectionJobInAzGraph.md
index 2caa15cf8039..6ed4af203c6c 100644
--- a/src/DataProtection/examples/Search-AzDataProtectionJobInAzGraph.md
+++ b/src/DataProtection/examples/Search-AzDataProtectionJobInAzGraph.md
@@ -1,9 +1,11 @@
### Example 1: Get all jobs in a certain time range
```powershell
-PS C:\> $endtime = get-date
-PS C:\> $starttime = $endtime.AddHours(-5)
-PS C:\> Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime
+$endtime = Get-Date
+$starttime = $endtime.AddHours(-5)
+Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime
+```
+```output
Name Type
---- ----
1c1d56c2-b21a-4038-ba46-3c1a0089e66a microsoft.dataprotection/backupvaults/backupjobs
@@ -15,8 +17,10 @@ This command gets all jobs in a vault in last 5 hours.
### Example 2: Get all jobs of a certain operation type
```powershell
-PS C:\> Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup
+Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup
+```
+```output
Name Type
---- ----
11bc277d-9448-446a-9e79-4721858524d6 microsoft.dataprotection/backupvaults/backupjobs
diff --git a/src/DataProtection/examples/Start-AzDataProtectionBackupInstanceRestore.md b/src/DataProtection/examples/Start-AzDataProtectionBackupInstanceRestore.md
index 028a070697f0..b5080388a849 100644
--- a/src/DataProtection/examples/Start-AzDataProtectionBackupInstanceRestore.md
+++ b/src/DataProtection/examples/Start-AzDataProtectionBackupInstanceRestore.md
@@ -1,23 +1,23 @@
### Example 1: Trigger restore for a protected azure disk.
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint $rp[0].name
-PS C:\> Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName sarath-rg -VaultName sarath-vault -SubscriptionId "xxx-xxx-xxx" -Parameter $restorerequest
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint $rp[0].name
+Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName sarath-rg -VaultName sarath-vault -SubscriptionId "xxx-xxx-xxx" -Parameter $restorerequest
```
### Example 2: Trigger restore as DB for protected AzureDatabaseForPostgreSQL using secret store.
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
-PS C:\> $targetResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/serverName/databases/targetDbName"
-PS C:\> $secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId $targetResourceId -RecoveryPoint $rp[0].Property.RecoveryPointId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
-PS C:\> $restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
-PS C:\> $jobid = $restoreJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
+$targetResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/serverName/databases/targetDbName"
+$secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId $targetResourceId -RecoveryPoint $rp[0].Property.RecoveryPointId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
+$restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
+$jobid = $restoreJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
{
Start-Sleep -Seconds 10
$currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
@@ -34,15 +34,15 @@ The seventh, eight, ninth commands track the restore job to completion.
### Example 3: Trigger restore as Files for protected AzureDatabaseForPostgreSQL.
```powershell
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
-PS C:\> $targetContainerURI = ""https://targetStorageAccount.blob.core.windows.net/targetContainerName""
-PS C:\> $fileNamePrefix = "restore_as_files_12345"
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType RestoreAsFiles -RecoveryPoint $rp[0].Property.RecoveryPointId -TargetContainerURI $targetContainerURI -FileNamePrefix $fileNamePrefix
-PS C:\> $restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
-PS C:\> $jobid = $restoreJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
+$targetContainerURI = ""https://targetStorageAccount.blob.core.windows.net/targetContainerName""
+$fileNamePrefix = "restore_as_files_12345"
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType RestoreAsFiles -RecoveryPoint $rp[0].Property.RecoveryPointId -TargetContainerURI $targetContainerURI -FileNamePrefix $fileNamePrefix
+$restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
+$jobid = $restoreJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
{
Start-Sleep -Seconds 10
$currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
diff --git a/src/DataProtection/examples/Stop-AzDataProtectionBackupInstanceProtection.md b/src/DataProtection/examples/Stop-AzDataProtectionBackupInstanceProtection.md
new file mode 100644
index 000000000000..4af2f1ee9f36
--- /dev/null
+++ b/src/DataProtection/examples/Stop-AzDataProtectionBackupInstanceProtection.md
@@ -0,0 +1,7 @@
+### Example 1: Stop protection for a backup instance
+```powershell
+PS C:\> Stop-AzDataProtectionBackupInstanceProtection -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+```
+
+ The above command can be used to stop protection of a backup instance
+
diff --git a/src/DataProtection/examples/Suspend-AzDataProtectionBackupInstanceBackup.md b/src/DataProtection/examples/Suspend-AzDataProtectionBackupInstanceBackup.md
new file mode 100644
index 000000000000..b05c7b68d15e
--- /dev/null
+++ b/src/DataProtection/examples/Suspend-AzDataProtectionBackupInstanceBackup.md
@@ -0,0 +1,7 @@
+### Example 1: Suspend backups for a backup instance
+```powershell
+PS C:\> Suspend-AzDataProtectionBackupInstanceBackup -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+```
+
+ The above command can be used to stop backups of a backup instance, this will move the backup instance to a suspended state.
+
diff --git a/src/DataProtection/examples/Sync-AzDataProtectionBackupInstance.md b/src/DataProtection/examples/Sync-AzDataProtectionBackupInstance.md
new file mode 100644
index 000000000000..6509fcc889fe
--- /dev/null
+++ b/src/DataProtection/examples/Sync-AzDataProtectionBackupInstance.md
@@ -0,0 +1,7 @@
+### Example 1: Sync backup instance again in case of failure
+```powershell
+PS C:\> Sync-AzDataProtectionBackupInstance -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+```
+
+ The above command is used to sync backup instance again in case of failure. This action will retry last failed operation and will bring backup instance to valid state.
+
diff --git a/src/DataProtection/examples/Update-AzDataProtectionBackupInstanceAssociatedPolicy.md b/src/DataProtection/examples/Update-AzDataProtectionBackupInstanceAssociatedPolicy.md
index 460999fe2a0f..ef0f173bba85 100644
--- a/src/DataProtection/examples/Update-AzDataProtectionBackupInstanceAssociatedPolicy.md
+++ b/src/DataProtection/examples/Update-AzDataProtectionBackupInstanceAssociatedPolicy.md
@@ -1,10 +1,12 @@
### Example 1: Update Associated policy of a backup instance
```powershell
-PS C:\> $sub = "xxxx-xxxx-xxxx"
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Update-AzDataProtectionBackupInstanceAssociatedPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[0].Name -PolicyId $policy[1].Id
+$sub = "xxxx-xxxx-xxxx"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
+Update-AzDataProtectionBackupInstanceAssociatedPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[0].Name -PolicyId $policy[1].Id
+```
+```output
Name Type BackupInstanceName
---- ---- ------------------
sarathdisk2-sarathdisk2-2ba3c708-3648-45e2-809d-9f75e66d404f Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-2ba3c708-3648-45e2-809d-9f75e66
diff --git a/src/DataProtection/examples/Update-AzDataProtectionBackupVault.md b/src/DataProtection/examples/Update-AzDataProtectionBackupVault.md
index 4cfb83a7d710..f4c8bbdd9614 100644
--- a/src/DataProtection/examples/Update-AzDataProtectionBackupVault.md
+++ b/src/DataProtection/examples/Update-AzDataProtectionBackupVault.md
@@ -1,8 +1,10 @@
### Example 1: Add tags to an existing backup vault
```powershell
-PS C:\> $tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
-PS C:\> Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
+$tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
+Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
+```
+```output
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
---- ------------------- ---------------- ------------ -------- ---- ----
2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
@@ -10,3 +12,13 @@ ETag IdentityPrincipalId IdentityTenantId I
The first command creates a new tag hashtable with tags and their values. The second command adds the given tags to the backup vault.
+### Example 2: Disable Azure monitor alerts for job failures
+```powershell
+PS C:\> Update-AzDataProtectionBackupVault -ResourceGroupName "rgName" -VaultName "vaultName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -AzureMonitorAlertsForAllJobFailure 'Disabled'
+
+Name Location Type IdentityType
+---- -------- ---- ------------
+vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
+```
+
+This command disables the monitor alerts for all the job failures for the backup vault. Allowed values are: Enabled, Disabled. Note that by default this setting is enabled.
diff --git a/src/DataProtection/examples/Update-AzDataProtectionResourceGuard.md b/src/DataProtection/examples/Update-AzDataProtectionResourceGuard.md
new file mode 100644
index 000000000000..0e4a947a2245
--- /dev/null
+++ b/src/DataProtection/examples/Update-AzDataProtectionResourceGuard.md
@@ -0,0 +1,16 @@
+### Example 1: Update a resource guard
+```powershell
+PS C:\> $resourceGuard = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "rgName" -Name "resGuardName"
+PS C:\> $criticalOperations = $resourceGuard.ResourceGuardOperation.VaultCriticalOperation
+PS C:\> $operationsToBeExcluded = $criticalOperations | where { $_ -match "backupSecurityPIN/action" -or $_ -match "backupInstances/delete" }
+PS C:\> Update-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "rgName" -Name $resourceGuard.Name -CriticalOperationExclusionList $operationsToBeExcluded
+```
+
+```output
+ETag Id IdentityPrincipalId IdentityTenantId IdentityType Location Name
+---- -- ------------------- ---------------- ------------ -------- ----
+ /subscriptions/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/mua-rg/providers/Microsoft.DataProtection/resourceGuards/mua-resource-guard centraluseuap mua-resource-guard
+```
+
+The first command is used to fetch the resource guard to be updated. The second and third command is used to fecth the critical operations user want to update.
+The fourth command is used to exclude some critical operations from the resource guard
\ No newline at end of file
diff --git a/src/DataProtection/exports/Backup-AzDataProtectionBackupInstanceAdhoc.ps1 b/src/DataProtection/exports/Backup-AzDataProtectionBackupInstanceAdhoc.ps1
index 67fe3826b119..3a4269ad7f7a 100644
--- a/src/DataProtection/exports/Backup-AzDataProtectionBackupInstanceAdhoc.ps1
+++ b/src/DataProtection/exports/Backup-AzDataProtectionBackupInstanceAdhoc.ps1
@@ -20,27 +20,26 @@ Trigger adhoc backup
.Description
Trigger adhoc backup
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName "BackupWeekly" -TriggerOptionRetentionTagOverride "Default"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName "BackupWeekly" -TriggerOptionRetentionTagOverride "Default"
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -VaultName "MyVault" -ResourceGroupName "MyResourceGroup" | where {$_.Name -eq "policyName"}
-PS C:\> $backupJob = Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName $policy.Property.PolicyRule[0].Name -TriggerOptionRetentionTagOverride $policy.Property.PolicyRule[0].Trigger.TaggingCriterion[0].TagInfoTagName
-PS C:\> $jobid = $backupJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
->> {
->> Start-Sleep -Seconds 10
->> $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId $sub -ResourceGroupName $rgName -VaultName $vaultName
->> $jobstatus = $currentjob.Status
->> }
-
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -VaultName "MyVault" -ResourceGroupName "MyResourceGroup" | Where-Object {$_.Name -eq "policyName"}
+$backupJob = Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName $policy.Property.PolicyRule[0].Name -TriggerOptionRetentionTagOverride $policy.Property.PolicyRule[0].Trigger.TaggingCriterion[0].TagInfoTagName
+$jobid = $backupJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
+{
+ Start-Sleep -Seconds 10
+ $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId $sub -ResourceGroupName $rgName -VaultName $vaultName
+ $jobstatus = $currentjob.Status
+}
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -63,7 +62,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/backup-azdataprotectionbackupinstanceadhoc
#>
function Backup-AzDataProtectionBackupInstanceAdhoc {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo])]
[CmdletBinding(DefaultParameterSetName='BackupExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='BackupExpanded', Mandatory)]
@@ -177,6 +176,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
BackupExpanded = 'Az.DataProtection.private\Backup-AzDataProtectionBackupInstanceAdhoc_BackupExpanded';
BackupViaIdentityExpanded = 'Az.DataProtection.private\Backup-AzDataProtectionBackupInstanceAdhoc_BackupViaIdentityExpanded';
@@ -191,6 +208,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -199,15 +217,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1 b/src/DataProtection/exports/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1
index 2405075cf961..00f49c490e1d 100644
--- a/src/DataProtection/exports/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1
+++ b/src/DataProtection/exports/Edit-AzDataProtectionPolicyRetentionRuleClientObject.ps1
@@ -20,22 +20,14 @@ Adds or removes Retention Rule to existing Policy
.Description
Adds or removes Retention Rule to existing Policy
.Example
-PS C:\> $pol = Get-AzDataProtectionPolicyTemplate
-PS C:\> $lifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 5
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -LifeCycles $lifecycle -IsDefault $false
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+$pol = Get-AzDataProtectionPolicyTemplate
+$lifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 5
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -LifeCycles $lifecycle -IsDefault $false
.Example
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -RemoveRule
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -RemoveRule
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -75,12 +67,12 @@ POLICY : Backup Policy Object
https://docs.microsoft.com/powershell/module/az.dataprotection/edit-azdataprotectionpolicyretentionruleclientobject
#>
function Edit-AzDataProtectionPolicyRetentionRuleClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(DefaultParameterSetName='RemoveRetention', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Backup Policy Object
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -105,7 +97,7 @@ param(
[Parameter(ParameterSetName='AddRetention', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle[]]
# Life cycles associated with the retention rule.
# To construct, see NOTES section for LIFECYCLES properties and create a hash table.
${LifeCycles}
@@ -118,6 +110,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
RemoveRetention = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyRetentionRuleClientObject';
AddRetention = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyRetentionRuleClientObject';
@@ -129,6 +139,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -137,15 +148,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Edit-AzDataProtectionPolicyTagClientObject.ps1 b/src/DataProtection/exports/Edit-AzDataProtectionPolicyTagClientObject.ps1
index 649c8d6aec32..8a8ab5fb29f2 100644
--- a/src/DataProtection/exports/Edit-AzDataProtectionPolicyTagClientObject.ps1
+++ b/src/DataProtection/exports/Edit-AzDataProtectionPolicyTagClientObject.ps1
@@ -20,21 +20,13 @@ Adds or removes schedule tag in an existing backup policy.
.Description
Adds or removes schedule tag in an existing backup policy.
.Example
-PS C:\> $criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+$criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
+Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
.Example
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -75,12 +67,12 @@ POLICY : Backup Policy Object.
https://docs.microsoft.com/powershell/module/az.dataprotection/edit-azdataprotectionpolicytagclientobject
#>
function Edit-AzDataProtectionPolicyTagClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(DefaultParameterSetName='RemoveTag', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Backup Policy Object.
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -99,7 +91,7 @@ param(
[Parameter(ParameterSetName='updateTag', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria[]]
# Criterias to be associated with the schedule tag.
# To construct, see NOTES section for CRITERIA properties and create a hash table.
${Criteria}
@@ -112,6 +104,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
RemoveTag = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyTagClientObject';
updateTag = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyTagClientObject';
@@ -123,6 +133,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -131,15 +142,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Edit-AzDataProtectionPolicyTriggerClientObject.ps1 b/src/DataProtection/exports/Edit-AzDataProtectionPolicyTriggerClientObject.ps1
index 1b7da6be3c76..c211e3e53688 100644
--- a/src/DataProtection/exports/Edit-AzDataProtectionPolicyTriggerClientObject.ps1
+++ b/src/DataProtection/exports/Edit-AzDataProtectionPolicyTriggerClientObject.ps1
@@ -20,15 +20,11 @@ Updates Backup schedule of an existing backup policy.
.Description
Updates Backup schedule of an existing backup policy.
.Example
-PS C:\> $schedule = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays (get-date) -IntervalType Daily -IntervalCount 1
-PS C:\> Edit-AzDataProtectionPolicyTriggerClientObject -Policy $pol -Schedule $schedule
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+$schedule = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays (Get-Date) -IntervalType Daily -IntervalCount 1
+Edit-AzDataProtectionPolicyTriggerClientObject -Policy $pol -Schedule $schedule
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -58,12 +54,12 @@ POLICY : Backup Policy object.
https://docs.microsoft.com/powershell/module/az.dataprotection/edit-azdataprotectionpolicytriggerclientobject
#>
function Edit-AzDataProtectionPolicyTriggerClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Backup Policy object.
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -82,6 +78,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyTriggerClientObject';
}
@@ -92,6 +106,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -100,15 +115,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Find-AzDataProtectionRestorableTimeRange.ps1 b/src/DataProtection/exports/Find-AzDataProtectionRestorableTimeRange.ps1
index 02e7a2de7a4d..66b1529004fc 100644
--- a/src/DataProtection/exports/Find-AzDataProtectionRestorableTimeRange.ps1
+++ b/src/DataProtection/exports/Find-AzDataProtectionRestorableTimeRange.ps1
@@ -20,23 +20,19 @@
.Description
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $pointInTimeRange.RestorableTimeRange | fl
-
-EndTime : 2021-04-24T08:57:36.4149422Z
-ObjectType : RestorableTimeRange
-StartTime : 2021-03-25T14:27:31.0000000Z
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$pointInTimeRange.RestorableTimeRange | Format-List
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupFindRestorableTimeRangesResponseResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupFindRestorableTimeRangesResponseResource
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/find-azdataprotectionrestorabletimerange
#>
function Find-AzDataProtectionRestorableTimeRange {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupFindRestorableTimeRangesResponseResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupFindRestorableTimeRangesResponseResource])]
[CmdletBinding(DefaultParameterSetName='FindExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -140,6 +136,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
FindExpanded = 'Az.DataProtection.private\Find-AzDataProtectionRestorableTimeRange_FindExpanded';
}
@@ -153,6 +167,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -161,15 +176,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/exports/Get-AzDataProtectionBackupInstance.ps1
index 83561470fc6e..01c651c84ada 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionBackupInstance.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionBackupInstance.ps1
@@ -20,24 +20,14 @@ Gets a backup instance with name in a backup vault
.Description
Gets a backup instance with name in a backup vault
.Example
-PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f�
-sarathdisk2-sarathdisk2-74b127dc-7bf0-48ef-bcef-dab186cc6f10 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-74b127dc-7bf0-48ef-bcef-dab186c�
-
+PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Example
-PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "BackupInstanceName"
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166
+PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "BackupInstanceName"
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -60,7 +50,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionbackupinstance
#>
function Get-AzDataProtectionBackupInstance {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -154,6 +144,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionBackupInstance_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionBackupInstance_GetViaIdentity';
@@ -169,6 +177,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -177,15 +186,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionBackupPolicy.ps1 b/src/DataProtection/exports/Get-AzDataProtectionBackupPolicy.ps1
index 361171ed57cd..c26a9826f478 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionBackupPolicy.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionBackupPolicy.ps1
@@ -20,23 +20,14 @@ Gets a backup policy belonging to a backup vault
.Description
Gets a backup policy belonging to a backup vault
.Example
-PS C:\> Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-
-Name Type
----- ----
-DiskPolicy1 Microsoft.DataProtection/backupVaults/backupPolicies
-DiskDailyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Example
-PS C:\> Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "MyPolicy"
-
-Name Type
----- ----
-MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "MyPolicy"
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -59,7 +50,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionbackuppolicy
#>
function Get-AzDataProtectionBackupPolicy {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -153,6 +144,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionBackupPolicy_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionBackupPolicy_GetViaIdentity';
@@ -168,6 +177,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -176,15 +186,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionBackupVault.ps1 b/src/DataProtection/exports/Get-AzDataProtectionBackupVault.ps1
index ffe42a866597..e5655c580dfa 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionBackupVault.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionBackupVault.ps1
@@ -20,32 +20,16 @@ Returns resource collection belonging to a resource group.
.Description
Returns resource collection belonging to a resource group.
.Example
-PS C:\> Get-AzDataProtectionBackupVault
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 2a21f108-07bc-4c22-a221-f26c9de554ba 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned westus adigupt-backupcenter-ga-Vault Microsoft.DataProtection/backupV�
- 34237b3f-8f2c-4ae7-bbff-2896491976fb 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned westcentralus BC-Usability-Vault-WCUS Microsoft.DataProtection/backupV�
- 41155247-420f-4052-a894-84814f0b983c 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap NilayBackupVault Microsoft.DataProtection/backupV�
- 26da260b-e232-419c-8586-9157e4f6260e 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap dpprunnervaultus Microsoft.DataProtection/backupV�
+Get-AzDataProtectionBackupVault
.Example
-PS C:\> Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 05400379-2551-4dc9-86e0-cf59ab05405a 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-dppvault Microsoft.DataProtection/backupVaults
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg
.Example
-PS C:\> Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -68,7 +52,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionbackupvault
#>
function Get-AzDataProtectionBackupVault {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource])]
[CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get1', Mandatory)]
@@ -154,6 +138,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get1 = 'Az.DataProtection.private\Get-AzDataProtectionBackupVault_Get1';
Get2 = 'Az.DataProtection.private\Get-AzDataProtectionBackupVault_Get2';
@@ -169,6 +171,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -177,15 +180,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionJob.ps1 b/src/DataProtection/exports/Get-AzDataProtectionJob.ps1
index 2039601388d2..377be73e899a 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionJob.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionJob.ps1
@@ -20,27 +20,14 @@ Gets a job with id in a backup vault
.Description
Gets a job with id in a backup vault
.Example
-PS C:\> Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-
-Name Type
----- ----
-a6a4879d-f914-4174-b129-0e27da8a4fb0 Microsoft.DataProtection/backupVaults/backupJobs
-1a402664-a245-4a9d-8bb5-a6bafbb40d26 Microsoft.DataProtection/backupVaults/backupJobs
-672564f7-1f91-46e2-a0ca-4fb1dc977a1c Microsoft.DataProtection/backupVaults/backupJobs
-1653a7b4-8ce4-457e-8084-dc1c9d9e4106 Microsoft.DataProtection/backupVaults/backupJobs
-9f21c438-ca0d-45c1-88fe-79f08a8342c7 Microsoft.DataProtection/backupVaults/backupJobs
-736bab4d-480f-49f8-92ea-57c5ff203c33 Microsoft.DataProtection/backupVaults/backupJobs
+Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
.Example
-PS C:\> Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Id 4abaea8c-f53a-4bb1-9963-59f96b597165
-
-Name Type
----- ----
-4abaea8c-f53a-4bb1-9963-59f96b597165 Microsoft.DataProtection/backupVaults/backupJobs
+Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Id 4abaea8c-f53a-4bb1-9963-59f96b597165
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupJobResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupJobResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -63,7 +50,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionjob
#>
function Get-AzDataProtectionJob {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupJobResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupJobResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -159,6 +146,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionJob_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionJob_GetViaIdentity';
@@ -174,6 +179,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -182,15 +188,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionOperation.ps1 b/src/DataProtection/exports/Get-AzDataProtectionOperation.ps1
index a00248edac81..7c63819e416a 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionOperation.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionOperation.ps1
@@ -20,70 +20,15 @@ Returns the list of available operations.
.Description
Returns the list of available operations.
.Example
-PS C:\> Get-AzDataProtectionOperation
-
-IsDataAction Name Origin
------------- ---- ------
- Microsoft.DataProtection/locations/getBackupStatus/action user
- Microsoft.DataProtection/backupVaults/backupInstances/write user
- Microsoft.DataProtection/backupVaults/backupInstances/delete user
- Microsoft.DataProtection/backupVaults/backupInstances/read user
- Microsoft.DataProtection/backupVaults/backupInstances/read user
- Microsoft.DataProtection/backupVaults/backupInstances/backup/action user
- Microsoft.DataProtection/backupVaults/backupInstances/sync/action user
- Microsoft.DataProtection/backupVaults/backupInstances/operationResults/read user
- Microsoft.DataProtection/backupVaults/backupInstances/stopProtection/action user
- Microsoft.DataProtection/backupVaults/backupInstances/suspendBackups/action user
- Microsoft.DataProtection/backupVaults/backupInstances/resumeProtection/action user
- Microsoft.DataProtection/backupVaults/backupInstances/resumeBackups/action user
- Microsoft.DataProtection/backupVaults/backupInstances/validateRestore/action user
- Microsoft.DataProtection/backupVaults/backupInstances/restore/action user
- Microsoft.DataProtection/backupVaults/backupPolicies/write user
- Microsoft.DataProtection/backupVaults/backupPolicies/delete user
- Microsoft.DataProtection/backupVaults/backupPolicies/read user
- Microsoft.DataProtection/backupVaults/backupPolicies/read user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/read user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/read user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/write user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/delete user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/unlockDelete/action user
- Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints/read user
- Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints/read user
- Microsoft.DataProtection/backupVaults/backupInstances/findRestorableTimeRanges/action user
- Microsoft.DataProtection/backupVaults/write user
- Microsoft.DataProtection/backupVaults/read user
- Microsoft.DataProtection/backupVaults/delete user
- Microsoft.DataProtection/backupVaults/operationResults/read user
- Microsoft.DataProtection/locations/checkNameAvailability/action user
- Microsoft.DataProtection/backupVaults/read user
- Microsoft.DataProtection/backupVaults/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/write user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/delete user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/read user
- Microsoft.DataProtection/subscriptions/providers/resourceGuards/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/write user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/{operationName}/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/{operationName}/read user
- Microsoft.DataProtection/subscriptions/providers/locations/checkFeatureSupport/action user
- Microsoft.DataProtection/locations/operationStatus/read user
- Microsoft.DataProtection/backupVaults/operationStatus/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/operationStatus/read user
- Microsoft.DataProtection/locations/operationResults/read user
- Microsoft.DataProtection/backupVaults/validateForBackup/action user
- Microsoft.DataProtection/backupVaults/backupJobs/read user
- Microsoft.RecoveryServices/Vaults/backupJobs/read user
- Microsoft.DataProtection/register/action user
- Microsoft.DataProtection/unregister/action user
- Microsoft.DataProtection/operations/read user
+Get-AzDataProtectionOperation
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IClientDiscoveryValueForSingleApi
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IClientDiscoveryValueForSingleApi
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionoperation
#>
function Get-AzDataProtectionOperation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IClientDiscoveryValueForSingleApi])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IClientDiscoveryValueForSingleApi])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter()]
@@ -141,6 +86,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
List = 'Az.DataProtection.private\Get-AzDataProtectionOperation_List';
}
@@ -151,6 +114,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -159,15 +123,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionPolicyTemplate.ps1 b/src/DataProtection/exports/Get-AzDataProtectionPolicyTemplate.ps1
index 85d2e0c20979..5deb8504171b 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionPolicyTemplate.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionPolicyTemplate.ps1
@@ -20,19 +20,15 @@ Gets default policy template for a selected datasource type.
.Description
Gets default policy template for a selected datasource type.
.Example
-PS C:\> Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionpolicytemplate
#>
function Get-AzDataProtectionPolicyTemplate {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -49,6 +45,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Get-AzDataProtectionPolicyTemplate';
}
@@ -59,6 +73,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -67,15 +82,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionRecoveryPoint.ps1 b/src/DataProtection/exports/Get-AzDataProtectionRecoveryPoint.ps1
index 7c93b8308705..e8f3b271b61c 100644
--- a/src/DataProtection/exports/Get-AzDataProtectionRecoveryPoint.ps1
+++ b/src/DataProtection/exports/Get-AzDataProtectionRecoveryPoint.ps1
@@ -20,29 +20,16 @@ Gets a Recovery Point using recoveryPointId for a Datasource.
.Description
Gets a Recovery Point using recoveryPointId for a Datasource.
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name
-
-Name Type
----- ----
-aded40a562134f97b732f30d0b486fef Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-f458438d5ebb4098adbf67e9655cb624 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-515ba70e49d34b2bbff033dcc08593fe Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-e61293fdd1064fbdb4f42b7f5927a927 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-aecc362b85484f4eb905bb05ef445e3e Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-dc814d61a9624c36a1f9d635bc0b80f0 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name -Id 892e5c5014dc4a96807d22924f5745c9
-
-Name Type
----- ----
-892e5c5014dc4a96807d22924f5745c9 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name -Id 892e5c5014dc4a96807d22924f5745c9
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRecoveryPointResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRecoveryPointResource
.Outputs
System.Management.Automation.PSObject
.Notes
@@ -67,7 +54,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionrecoverypoint
#>
function Get-AzDataProtectionRecoveryPoint {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRecoveryPointResource], [PSObject])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRecoveryPointResource], [PSObject])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -180,6 +167,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionRecoveryPoint_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionRecoveryPoint_GetViaIdentity';
@@ -195,6 +200,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -203,15 +209,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Get-AzDataProtectionResourceGuard.ps1 b/src/DataProtection/exports/Get-AzDataProtectionResourceGuard.ps1
new file mode 100644
index 000000000000..0f812f41ed16
--- /dev/null
+++ b/src/DataProtection/exports/Get-AzDataProtectionResourceGuard.ps1
@@ -0,0 +1,211 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Returns a ResourceGuard belonging to a resource group.
+.Description
+Returns a ResourceGuard belonging to a resource group.
+.Example
+PS C:\> $resGuard = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "RGName" -Name "ResourceGuardName"
+PS C:\> $resGuard
+.Example
+PS C:\> $resGuardList = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "RGName"
+PS C:\> $resGuardList
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionresourceguard
+#>
+function Get-AzDataProtectionResourceGuard {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource])]
+[CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of ResourceGuard
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='Get1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='Get1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.DataProtection.private\Get-AzDataProtectionResourceGuard_Get';
+ Get1 = 'Az.DataProtection.private\Get-AzDataProtectionResourceGuard_Get1';
+ GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionResourceGuard_GetViaIdentity';
+ }
+ if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/Initialize-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/exports/Initialize-AzDataProtectionBackupInstance.ps1
index 6c36ab4d4cbf..b2f5ee5243ff 100644
--- a/src/DataProtection/exports/Initialize-AzDataProtectionBackupInstance.ps1
+++ b/src/DataProtection/exports/Initialize-AzDataProtectionBackupInstance.ps1
@@ -20,23 +20,19 @@ Initializes Backup instance Request object for configuring backup
.Description
Initializes Backup instance Request object for configuring backup
.Example
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> $AzureDiskId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{diskname}"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation westus -DatasourceId $AzureDiskId -PolicyId $policy[0].Id
-PS C:\> $instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{snapshotResourceGroup}"
-PS C:\> $instance
-
-Name Type BackupInstanceName
----- ---- ------------------
- sarath-disk3-sarath-disk3-af697a80-e2bc-49f1-af6c-22f6c4d68405
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+$AzureDiskId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{diskname}"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation westus -DatasourceId $AzureDiskId -PolicyId $policy[0].Id
+$instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{snapshotResourceGroup}"
+$instance
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/initialize-azdataprotectionbackupinstance
#>
function Initialize-AzDataProtectionBackupInstance {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -85,6 +81,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Initialize-AzDataProtectionBackupInstance';
}
@@ -95,6 +109,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -103,15 +118,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Initialize-AzDataProtectionRestoreRequest.ps1 b/src/DataProtection/exports/Initialize-AzDataProtectionRestoreRequest.ps1
index c324d7f6f00c..7d551cd7c9f3 100644
--- a/src/DataProtection/exports/Initialize-AzDataProtectionRestoreRequest.ps1
+++ b/src/DataProtection/exports/Initialize-AzDataProtectionRestoreRequest.ps1
@@ -20,54 +20,34 @@ Initializes Restore Request object for triggering restore on a protected backup
.Description
Initializes Restore Request object for triggering restore on a protected backup instance.
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint "892e5c5014dc4a96807d22924f5745c9"
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointI
- d
----------- --------------------------- ------------------------------- -------------------------------- ------------------- --------------
-AzureBackupRecoveryPointBasedRestoreRequest RestoreTargetInfo FailIfExists westus OperationalStore 892e5c5014dc4a96807d22924f5745c9
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint "892e5c5014dc4a96807d22924f5745c9"
+$restoreRequest
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instance[0] -PointInTime (Get-Date -Date $pointInTimeRange.RestorableTimeRange.EndTime)
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
----------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
-AzureBackupRecoveryTimeBasedRestoreRequest restoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-24T13:32:41.7018481Z
-
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instance[0] -PointInTime (Get-Date -Date $pointInTimeRange.RestorableTimeRange.EndTime)
+$restoreRequest
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -ContainersList "containerName1","containerName2"
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
----------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
-AzureBackupRecoveryTimeBasedRestoreRequest itemLevelRestoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-23T02:47:02.9500000Z
-
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -ContainersList "containerName1","containerName2"
+$restoreRequest
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -FromPrefixPattern "container1/aaa","container1/ccc", "container2/aab", "container3" -ToPrefixPattern "container1/bbb","container1/ddd", "container2/abc", "container3-0"
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
----------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
-AzureBackupRecoveryTimeBasedRestoreRequest itemLevelRestoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-23T02:47:02.9500000Z
-
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -FromPrefixPattern "container1/aaa","container1/ccc", "container2/aab", "container3" -ToPrefixPattern "container1/bbb","container1/ddd", "container2/abc", "container3-0"
+$restoreRequest
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -101,11 +81,12 @@ BACKUPINSTANCE : Backup Instance object to trigger origi
[DatasourceAuthCredentials ]: Credentials to use to authenticate with data source provider.
ObjectType : Type of the specific object - used for deserializing
[FriendlyName ]: Gets or sets the Backup Instance friendly name.
+ [ValidationType ]: Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again.
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/initialize-azdataprotectionrestorerequest
#>
function Initialize-AzDataProtectionRestoreRequest {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest])]
[CmdletBinding(DefaultParameterSetName='AlternateLocationFullRecovery', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -180,7 +161,7 @@ param(
[Parameter(ParameterSetName='OriginalLocationILR', Mandatory)]
[Parameter(ParameterSetName='OriginalLocationFullRecovery', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource]
# Backup Instance object to trigger original localtion restore.
# To construct, see NOTES section for BACKUPINSTANCE properties and create a hash table.
${BackupInstance},
@@ -231,6 +212,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
RestoreAsFiles = 'Az.DataProtection.custom\Initialize-AzDataProtectionRestoreRequest';
OriginalLocationILR = 'Az.DataProtection.custom\Initialize-AzDataProtectionRestoreRequest';
@@ -244,6 +243,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -252,15 +252,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/exports/New-AzDataProtectionBackupInstance.ps1
index 1bb47c84b023..a8447621bef3 100644
--- a/src/DataProtection/exports/New-AzDataProtectionBackupInstance.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionBackupInstance.ps1
@@ -20,30 +20,20 @@ Configures Backup for supported azure resources
.Description
Configures Backup for supported azure resources
.Example
-PS C:\> $sub = "xxxx-xxx-xx"
-PS C:\> $DiskId = "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{diskname}"
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $DiskId
-PS C:\> $instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}"
-PS C:\> New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstance $instance
-
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166
+$sub = "xxxx-xxx-xx"
+$DiskId = "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{diskname}"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $DiskId
+$instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}"
+New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstance $instance
.Example
-PS C:\> $sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
-PS C:\> $dataSourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/OssServerName/databases/DBName"
-PS C:\> $secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
-PS C:\> $vault = Get-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName $vaultName
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -Name "MyPolicy"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDatabaseForPostgreSQL -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $dataSourceId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
-PS C:\> New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -BackupInstance $instance
-
-Name Type BackupInstanceName
----- ---- ------------------
-xyz-postgresql-wus-empdb10-xxxxxxxx-xxxx-xxxx-a3ba-be75108d8b21 Microsoft.DataProtection/backupVaults/backupInstances xyz-postgresql-wus-empdb10-xxxxxxxx-xxxx-xxxx-a3ba-be75108d8b21
-
+$sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
+$dataSourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/OssServerName/databases/DBName"
+$secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
+$vault = Get-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName $vaultName
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -Name "MyPolicy"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDatabaseForPostgreSQL -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $dataSourceId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
+New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -BackupInstance $instance
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -78,6 +68,7 @@ BACKUPINSTANCE : Backup instance request object which w
[DatasourceAuthCredentials ]: Credentials to use to authenticate with data source provider.
ObjectType : Type of the specific object - used for deserializing
[FriendlyName ]: Gets or sets the Backup Instance friendly name.
+ [ValidationType ]: Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again.
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionbackupinstance
#>
@@ -98,7 +89,7 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource]
# Backup instance request object which will be used to configure backup
# To construct, see NOTES section for BACKUPINSTANCE properties and create a hash table.
${BackupInstance},
@@ -167,6 +158,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupInstance';
}
@@ -177,6 +186,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -185,15 +195,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionBackupPolicy.ps1 b/src/DataProtection/exports/New-AzDataProtectionBackupPolicy.ps1
index 3b8562f8d6b0..a3a659e05949 100644
--- a/src/DataProtection/exports/New-AzDataProtectionBackupPolicy.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionBackupPolicy.ps1
@@ -20,18 +20,14 @@ Creates a new backup policy in a given backup vault
.Description
Creates a new backup policy in a given backup vault
.Example
-PS C:\> $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
-PS C:\> New-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy" -Policy $defaultPol
-
-Name Type
----- ----
-MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
+New-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy" -Policy $defaultPol
.Example
-PS C:\> $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL
-PS C:\> $lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 3 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
-PS C:\> $lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $true
-PS C:\> $schDates = @(
+$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL
+$lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 3 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
+$lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $true
+$schDates = @(
(
(Get-Date -Year 2021 -Month 08 -Day 18 -Hour 10 -Minute 0 -Second 0)
),
@@ -39,22 +35,17 @@ PS C:\> $schDates = @(
(Get-Date -Year 2021 -Month 08 -Day 22 -Hour 10 -Minute 0 -Second 0)
))
-PS C:\> $trigger = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $schDates -IntervalType Weekly -IntervalCount 1
-PS C:\> Edit-AzDataProtectionPolicyTriggerClientObject -Schedule $trigger -Policy $defaultPol
-PS C:\> $lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
-PS C:\> $lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 12
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Monthly -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $false
-PS C:\> $tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfMonth
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $defaultPol -Name Monthly -Criteria $tagCriteria
-PS C:\> New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "MyPolicy" -Policy $defaultPol
-
-
-Name Type
----- ----
-MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+$trigger = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $schDates -IntervalType Weekly -IntervalCount 1
+Edit-AzDataProtectionPolicyTriggerClientObject -Schedule $trigger -Policy $defaultPol
+$lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
+$lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 12
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Monthly -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $false
+$tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfMonth
+Edit-AzDataProtectionPolicyTagClientObject -Policy $defaultPol -Name Monthly -Criteria $tagCriteria
+New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "MyPolicy" -Policy $defaultPol
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -84,7 +75,7 @@ POLICY : Policy Request Object
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionbackuppolicy
#>
function New-AzDataProtectionBackupPolicy {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource])]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -107,7 +98,7 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Policy Request Object
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -166,6 +157,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupPolicy';
}
@@ -176,6 +185,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -184,15 +194,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionBackupVault.ps1 b/src/DataProtection/exports/New-AzDataProtectionBackupVault.ps1
index 4399931622ba..f7e3ea9fa6c3 100644
--- a/src/DataProtection/exports/New-AzDataProtectionBackupVault.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionBackupVault.ps1
@@ -20,13 +20,9 @@ Creates or updates a BackupVault resource belonging to a resource group.
.Description
Creates or updates a BackupVault resource belonging to a resource group.
.Example
-PS C:\> $sub = "xxxx-xxxx-xxxxx"
-PS C:\> $storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
-PS C:\> New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- westus MyVault Microsoft.DataProtection/backupVaults
+$sub = "xxxx-xxxx-xxxxx"
+$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
+New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus
.Outputs
System.Management.Automation.PSObject
@@ -65,7 +61,7 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IStorageSetting[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IStorageSetting[]]
# Storage Settings of the vault.
# Use New-AzDataProtectionBackupVaultStorageSetting Cmdlet to Create.
# To construct, see NOTES section for STORAGESETTING properties and create a hash table.
@@ -89,6 +85,13 @@ param(
# The identityType which can be either SystemAssigned or None.
${IdentityType},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState]
+ # Parameter to Enable or Disable built-in azure monitor alerts for job failures.
+ # Security alerts cannot be disabled.
+ ${AzureMonitorAlertsForAllJobFailure},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
[System.Collections.Hashtable]
@@ -153,6 +156,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupVault';
}
@@ -163,6 +184,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -171,15 +193,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionBackupVaultStorageSettingObject.ps1 b/src/DataProtection/exports/New-AzDataProtectionBackupVaultStorageSettingObject.ps1
index f240af418e72..02c32edd60aa 100644
--- a/src/DataProtection/exports/New-AzDataProtectionBackupVaultStorageSettingObject.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionBackupVaultStorageSettingObject.ps1
@@ -20,11 +20,7 @@ Get Backup Vault storage setting object
.Description
Get Backup Vault storage setting object
.Example
-PS C:\> New-AzDataProtectionBackupVaultStorageSettingObject -Type GeoRedundant -DataStoreType VaultStore
-
-DatastoreType Type
-------------- ----
-VaultStore GeoRedundant
+New-AzDataProtectionBackupVaultStorageSettingObject -Type GeoRedundant -DataStoreType VaultStore
.Outputs
System.Management.Automation.PSObject
@@ -55,6 +51,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupVaultStorageSettingObject';
}
@@ -65,6 +79,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -73,15 +88,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1 b/src/DataProtection/exports/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1
index 54970c9af0fe..904a2fb615a2 100644
--- a/src/DataProtection/exports/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionPolicyTagCriteriaClientObject.ps1
@@ -20,25 +20,17 @@ Creates a new criteria object
.Description
Creates a new criteria object
.Example
-PS C:\> New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfDay
-
-ObjectType AbsoluteCriterion DaysOfTheWeek MonthsOfYear ScheduleTime WeeksOfTheMonth
----------- ----------------- ------------- ------------ ------------ ---------------
-ScheduleBasedBackupCriteria {FirstOfDay}
+New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfDay
.Example
-PS C:\> New-AzDataProtectionPolicyTagCriteriaClientObject -DaysOfWeek @("Sunday", "Monday")
-
-ObjectType AbsoluteCriterion DaysOfTheWeek MonthsOfYear ScheduleTime WeeksOfTheMonth
----------- ----------------- ------------- ------------ ------------ ---------------
-ScheduleBasedBackupCriteria {Sunday, Monday}
+New-AzDataProtectionPolicyTagCriteriaClientObject -DaysOfWeek @("Sunday", "Monday")
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionpolicytagcriteriaclientobject
#>
function New-AzDataProtectionPolicyTagCriteriaClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria])]
[CmdletBinding(DefaultParameterSetName='ScheduleCriteria', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='AbsoluteCriteria', Mandatory)]
@@ -88,6 +80,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
AbsoluteCriteria = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTagCriteriaClientObject';
ScheduleCriteria = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTagCriteriaClientObject';
@@ -100,6 +110,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -108,15 +119,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionPolicyTriggerScheduleClientObject.ps1 b/src/DataProtection/exports/New-AzDataProtectionPolicyTriggerScheduleClientObject.ps1
index f244174ff443..6952b45b4a47 100644
--- a/src/DataProtection/exports/New-AzDataProtectionPolicyTriggerScheduleClientObject.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionPolicyTriggerScheduleClientObject.ps1
@@ -20,15 +20,11 @@ Creates new Schedule object
.Description
Creates new Schedule object
.Example
-PS C:\> $date = get-date
-PS C:\> New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Daily -IntervalCount 1
-
-R/2021-03-03T12:49:55+05:30/P1D
+$date = Get-Date
+New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Daily -IntervalCount 1
.Example
-PS C:\> $date = get-date
-PS C:\> New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Hourly -IntervalCount 4
-
-R/2021-03-03T12:49:55+05:30/PT4H
+$date = Get-Date
+New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Hourly -IntervalCount 4
.Outputs
System.String[]
@@ -65,6 +61,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTriggerScheduleClientObject';
}
@@ -75,6 +89,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -83,15 +98,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/New-AzDataProtectionResourceGuard.ps1 b/src/DataProtection/exports/New-AzDataProtectionResourceGuard.ps1
new file mode 100644
index 000000000000..e6fa404c99a8
--- /dev/null
+++ b/src/DataProtection/exports/New-AzDataProtectionResourceGuard.ps1
@@ -0,0 +1,189 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Creates a resource guard under a resource group
+.Description
+Creates a resource guard under a resource group
+.Example
+PS C:\> New-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "mua-rg" -Name "mua-resource-guard" -Location "centraluseuap"
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionresourceguard
+#>
+function New-AzDataProtectionResourceGuard {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource])]
+[CmdletBinding(DefaultParameterSetName='CreateResourceGuard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Resource Group name of the resource guard
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Name of the resource guard
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Location of the resource guard
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Subscription Id of the resource guard
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Optional ETag
+ ${ETag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # The IdentityType to be added to the resource guard, example: SystemAssigned, None
+ ${IdentityType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSObject]
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Uri]
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSCredential]
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ CreateResourceGuard = 'Az.DataProtection.custom\New-AzDataProtectionResourceGuard';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/New-AzDataProtectionRetentionLifeCycleClientObject.ps1 b/src/DataProtection/exports/New-AzDataProtectionRetentionLifeCycleClientObject.ps1
index 0da3d9c91df6..21da967650a6 100644
--- a/src/DataProtection/exports/New-AzDataProtectionRetentionLifeCycleClientObject.ps1
+++ b/src/DataProtection/exports/New-AzDataProtectionRetentionLifeCycleClientObject.ps1
@@ -20,29 +20,17 @@ Creates new Lifecycle object
.Description
Creates new Lifecycle object
.Example
-PS C:\> New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30
-
-DeleteAfterDuration : P30D
-DeleteAfterObjectType : AbsoluteDeleteOption
-SourceDataStoreObjectType : DataStoreInfoBase
-SourceDataStoreType : OperationalStore
-TargetDataStoreCopySetting :
+New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30
.Example
-PS C:\> New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 20
-
-DeleteAfterDuration : P20W
-DeleteAfterObjectType : AbsoluteDeleteOption
-SourceDataStoreObjectType : DataStoreInfoBase
-SourceDataStoreType : OperationalStore
-TargetDataStoreCopySetting :
+New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 20
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionretentionlifecycleclientobject
#>
function New-AzDataProtectionRetentionLifeCycleClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -83,6 +71,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionRetentionLifeCycleClientObject';
}
@@ -93,6 +99,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -101,15 +108,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/ProxyCmdletDefinitions.ps1 b/src/DataProtection/exports/ProxyCmdletDefinitions.ps1
index fef436df0cc2..4dad5a2e7121 100644
--- a/src/DataProtection/exports/ProxyCmdletDefinitions.ps1
+++ b/src/DataProtection/exports/ProxyCmdletDefinitions.ps1
@@ -20,27 +20,26 @@ Trigger adhoc backup
.Description
Trigger adhoc backup
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName "BackupWeekly" -TriggerOptionRetentionTagOverride "Default"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName "BackupWeekly" -TriggerOptionRetentionTagOverride "Default"
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -VaultName "MyVault" -ResourceGroupName "MyResourceGroup" | where {$_.Name -eq "policyName"}
-PS C:\> $backupJob = Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName $policy.Property.PolicyRule[0].Name -TriggerOptionRetentionTagOverride $policy.Property.PolicyRule[0].Trigger.TaggingCriterion[0].TagInfoTagName
-PS C:\> $jobid = $backupJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
->> {
->> Start-Sleep -Seconds 10
->> $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId $sub -ResourceGroupName $rgName -VaultName $vaultName
->> $jobstatus = $currentjob.Status
->> }
-
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -VaultName "MyVault" -ResourceGroupName "MyResourceGroup" | Where-Object {$_.Name -eq "policyName"}
+$backupJob = Backup-AzDataProtectionBackupInstanceAdhoc -BackupInstanceName $instance.Name -ResourceGroupName "MyResourceGroup" -SubscriptionId "xxxx-xxx-xxxx" -VaultName "MyVault" -BackupRuleOptionRuleName $policy.Property.PolicyRule[0].Name -TriggerOptionRetentionTagOverride $policy.Property.PolicyRule[0].Trigger.TaggingCriterion[0].TagInfoTagName
+$jobid = $backupJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
+{
+ Start-Sleep -Seconds 10
+ $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId $sub -ResourceGroupName $rgName -VaultName $vaultName
+ $jobstatus = $currentjob.Status
+}
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -63,7 +62,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/backup-azdataprotectionbackupinstanceadhoc
#>
function Backup-AzDataProtectionBackupInstanceAdhoc {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo])]
[CmdletBinding(DefaultParameterSetName='BackupExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='BackupExpanded', Mandatory)]
@@ -177,6 +176,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
BackupExpanded = 'Az.DataProtection.private\Backup-AzDataProtectionBackupInstanceAdhoc_BackupExpanded';
BackupViaIdentityExpanded = 'Az.DataProtection.private\Backup-AzDataProtectionBackupInstanceAdhoc_BackupViaIdentityExpanded';
@@ -191,6 +208,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -199,17 +217,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -218,23 +253,19 @@ end {
.Description
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $pointInTimeRange.RestorableTimeRange | fl
-
-EndTime : 2021-04-24T08:57:36.4149422Z
-ObjectType : RestorableTimeRange
-StartTime : 2021-03-25T14:27:31.0000000Z
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "subscriptionId" -DatasourceType AzureBlob -ResourceGroup "rgName" -Vault "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instances[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$pointInTimeRange.RestorableTimeRange | Format-List
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupFindRestorableTimeRangesResponseResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupFindRestorableTimeRangesResponseResource
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/find-azdataprotectionrestorabletimerange
#>
function Find-AzDataProtectionRestorableTimeRange {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupFindRestorableTimeRangesResponseResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupFindRestorableTimeRangesResponseResource])]
[CmdletBinding(DefaultParameterSetName='FindExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -338,6 +369,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
FindExpanded = 'Az.DataProtection.private\Find-AzDataProtectionRestorableTimeRange_FindExpanded';
}
@@ -351,6 +400,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -359,17 +409,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -378,24 +445,14 @@ Gets a backup instance with name in a backup vault
.Description
Gets a backup instance with name in a backup vault
.Example
-PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f�
-sarathdisk2-sarathdisk2-74b127dc-7bf0-48ef-bcef-dab186cc6f10 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-74b127dc-7bf0-48ef-bcef-dab186c�
-
+PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Example
-PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "BackupInstanceName"
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166
+PS C:\> Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "BackupInstanceName"
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -418,7 +475,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionbackupinstance
#>
function Get-AzDataProtectionBackupInstance {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -512,6 +569,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionBackupInstance_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionBackupInstance_GetViaIdentity';
@@ -527,6 +602,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -535,17 +611,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -554,23 +647,14 @@ Gets a backup policy belonging to a backup vault
.Description
Gets a backup policy belonging to a backup vault
.Example
-PS C:\> Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-
-Name Type
----- ----
-DiskPolicy1 Microsoft.DataProtection/backupVaults/backupPolicies
-DiskDailyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Example
-PS C:\> Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "MyPolicy"
-
-Name Type
----- ----
-MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name "MyPolicy"
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -593,7 +677,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionbackuppolicy
#>
function Get-AzDataProtectionBackupPolicy {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -687,6 +771,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionBackupPolicy_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionBackupPolicy_GetViaIdentity';
@@ -702,6 +804,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -710,17 +813,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -729,32 +849,16 @@ Returns resource collection belonging to a resource group.
.Description
Returns resource collection belonging to a resource group.
.Example
-PS C:\> Get-AzDataProtectionBackupVault
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 2a21f108-07bc-4c22-a221-f26c9de554ba 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned westus adigupt-backupcenter-ga-Vault Microsoft.DataProtection/backupV�
- 34237b3f-8f2c-4ae7-bbff-2896491976fb 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned westcentralus BC-Usability-Vault-WCUS Microsoft.DataProtection/backupV�
- 41155247-420f-4052-a894-84814f0b983c 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap NilayBackupVault Microsoft.DataProtection/backupV�
- 26da260b-e232-419c-8586-9157e4f6260e 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap dpprunnervaultus Microsoft.DataProtection/backupV�
+Get-AzDataProtectionBackupVault
.Example
-PS C:\> Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 05400379-2551-4dc9-86e0-cf59ab05405a 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-dppvault Microsoft.DataProtection/backupVaults
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg
.Example
-PS C:\> Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -777,7 +881,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionbackupvault
#>
function Get-AzDataProtectionBackupVault {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource])]
[CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get1', Mandatory)]
@@ -863,6 +967,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get1 = 'Az.DataProtection.private\Get-AzDataProtectionBackupVault_Get1';
Get2 = 'Az.DataProtection.private\Get-AzDataProtectionBackupVault_Get2';
@@ -878,6 +1000,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -886,17 +1009,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -905,27 +1045,14 @@ Gets a job with id in a backup vault
.Description
Gets a job with id in a backup vault
.Example
-PS C:\> Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-
-Name Type
----- ----
-a6a4879d-f914-4174-b129-0e27da8a4fb0 Microsoft.DataProtection/backupVaults/backupJobs
-1a402664-a245-4a9d-8bb5-a6bafbb40d26 Microsoft.DataProtection/backupVaults/backupJobs
-672564f7-1f91-46e2-a0ca-4fb1dc977a1c Microsoft.DataProtection/backupVaults/backupJobs
-1653a7b4-8ce4-457e-8084-dc1c9d9e4106 Microsoft.DataProtection/backupVaults/backupJobs
-9f21c438-ca0d-45c1-88fe-79f08a8342c7 Microsoft.DataProtection/backupVaults/backupJobs
-736bab4d-480f-49f8-92ea-57c5ff203c33 Microsoft.DataProtection/backupVaults/backupJobs
+Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
.Example
-PS C:\> Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Id 4abaea8c-f53a-4bb1-9963-59f96b597165
-
-Name Type
----- ----
-4abaea8c-f53a-4bb1-9963-59f96b597165 Microsoft.DataProtection/backupVaults/backupJobs
+Get-AzDataProtectionjob -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Id 4abaea8c-f53a-4bb1-9963-59f96b597165
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupJobResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupJobResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -948,7 +1075,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionjob
#>
function Get-AzDataProtectionJob {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupJobResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupJobResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -1044,6 +1171,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionJob_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionJob_GetViaIdentity';
@@ -1059,6 +1204,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -1067,17 +1213,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -1086,70 +1249,15 @@ Returns the list of available operations.
.Description
Returns the list of available operations.
.Example
-PS C:\> Get-AzDataProtectionOperation
-
-IsDataAction Name Origin
------------- ---- ------
- Microsoft.DataProtection/locations/getBackupStatus/action user
- Microsoft.DataProtection/backupVaults/backupInstances/write user
- Microsoft.DataProtection/backupVaults/backupInstances/delete user
- Microsoft.DataProtection/backupVaults/backupInstances/read user
- Microsoft.DataProtection/backupVaults/backupInstances/read user
- Microsoft.DataProtection/backupVaults/backupInstances/backup/action user
- Microsoft.DataProtection/backupVaults/backupInstances/sync/action user
- Microsoft.DataProtection/backupVaults/backupInstances/operationResults/read user
- Microsoft.DataProtection/backupVaults/backupInstances/stopProtection/action user
- Microsoft.DataProtection/backupVaults/backupInstances/suspendBackups/action user
- Microsoft.DataProtection/backupVaults/backupInstances/resumeProtection/action user
- Microsoft.DataProtection/backupVaults/backupInstances/resumeBackups/action user
- Microsoft.DataProtection/backupVaults/backupInstances/validateRestore/action user
- Microsoft.DataProtection/backupVaults/backupInstances/restore/action user
- Microsoft.DataProtection/backupVaults/backupPolicies/write user
- Microsoft.DataProtection/backupVaults/backupPolicies/delete user
- Microsoft.DataProtection/backupVaults/backupPolicies/read user
- Microsoft.DataProtection/backupVaults/backupPolicies/read user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/read user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/read user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/write user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/delete user
- Microsoft.DataProtection/backupVaults/backupResourceGuardProxies/unlockDelete/action user
- Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints/read user
- Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints/read user
- Microsoft.DataProtection/backupVaults/backupInstances/findRestorableTimeRanges/action user
- Microsoft.DataProtection/backupVaults/write user
- Microsoft.DataProtection/backupVaults/read user
- Microsoft.DataProtection/backupVaults/delete user
- Microsoft.DataProtection/backupVaults/operationResults/read user
- Microsoft.DataProtection/locations/checkNameAvailability/action user
- Microsoft.DataProtection/backupVaults/read user
- Microsoft.DataProtection/backupVaults/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/write user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/delete user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/read user
- Microsoft.DataProtection/subscriptions/providers/resourceGuards/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/write user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/{operationName}/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/resourceGuards/{operationName}/read user
- Microsoft.DataProtection/subscriptions/providers/locations/checkFeatureSupport/action user
- Microsoft.DataProtection/locations/operationStatus/read user
- Microsoft.DataProtection/backupVaults/operationStatus/read user
- Microsoft.DataProtection/subscriptions/resourceGroups/providers/operationStatus/read user
- Microsoft.DataProtection/locations/operationResults/read user
- Microsoft.DataProtection/backupVaults/validateForBackup/action user
- Microsoft.DataProtection/backupVaults/backupJobs/read user
- Microsoft.RecoveryServices/Vaults/backupJobs/read user
- Microsoft.DataProtection/register/action user
- Microsoft.DataProtection/unregister/action user
- Microsoft.DataProtection/operations/read user
+Get-AzDataProtectionOperation
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IClientDiscoveryValueForSingleApi
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IClientDiscoveryValueForSingleApi
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionoperation
#>
function Get-AzDataProtectionOperation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IClientDiscoveryValueForSingleApi])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IClientDiscoveryValueForSingleApi])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter()]
@@ -1207,6 +1315,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
List = 'Az.DataProtection.private\Get-AzDataProtectionOperation_List';
}
@@ -1217,6 +1343,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -1225,17 +1352,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -1244,29 +1388,16 @@ Gets a Recovery Point using recoveryPointId for a Datasource.
.Description
Gets a Recovery Point using recoveryPointId for a Datasource.
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name
-
-Name Type
----- ----
-aded40a562134f97b732f30d0b486fef Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-f458438d5ebb4098adbf67e9655cb624 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-515ba70e49d34b2bbff033dcc08593fe Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-e61293fdd1064fbdb4f42b7f5927a927 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-aecc362b85484f4eb905bb05ef445e3e Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
-dc814d61a9624c36a1f9d635bc0b80f0 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name -Id 892e5c5014dc4a96807d22924f5745c9
-
-Name Type
----- ----
-892e5c5014dc4a96807d22924f5745c9 Microsoft.DataProtection/backupVaults/backupInstances/recoveryPoints
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[2].Name -Id 892e5c5014dc4a96807d22924f5745c9
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRecoveryPointResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRecoveryPointResource
.Outputs
System.Management.Automation.PSObject
.Notes
@@ -1291,7 +1422,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionrecoverypoint
#>
function Get-AzDataProtectionRecoveryPoint {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRecoveryPointResource], [PSObject])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRecoveryPointResource], [PSObject])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -1404,6 +1535,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Get = 'Az.DataProtection.private\Get-AzDataProtectionRecoveryPoint_Get';
GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionRecoveryPoint_GetViaIdentity';
@@ -1419,6 +1568,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -1427,33 +1577,52 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
.Synopsis
-Delete a backupInstances
+Returns a ResourceGuard belonging to a resource group.
.Description
-Delete a backupInstances
+Returns a ResourceGuard belonging to a resource group.
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Remove-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name $instance[0].name
-
+PS C:\> $resGuard = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "RGName" -Name "ResourceGuardName"
+PS C:\> $resGuard
+.Example
+PS C:\> $resGuardList = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "RGName"
+PS C:\> $resGuardList
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-System.Boolean
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -1473,39 +1642,34 @@ INPUTOBJECT : Identity Parameter
[SubscriptionId ]: The subscription Id.
[VaultName ]: The name of the backup vault.
.Link
-https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionbackupinstance
+https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionresourceguard
#>
-function Remove-AzDataProtectionBackupInstance {
-[OutputType([System.Boolean])]
-[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+function Get-AzDataProtectionResourceGuard {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource])]
+[CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)]
param(
- [Parameter(ParameterSetName='Delete', Mandatory)]
- [Alias('BackupInstanceName')]
+ [Parameter(ParameterSetName='Get', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[System.String]
- # The name of the backup instance
+ # The name of ResourceGuard
${Name},
- [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='Get1', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[System.String]
# The name of the resource group where the backup vault is present.
${ResourceGroupName},
- [Parameter(ParameterSetName='Delete')]
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='Get1')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
- [System.String]
+ [System.String[]]
# The subscription Id.
${SubscriptionId},
- [Parameter(ParameterSetName='Delete', Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
- [System.String]
- # The name of the backup vault.
- ${VaultName},
-
- [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
# Identity Parameter
@@ -1520,12 +1684,6 @@ param(
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Run the command as a job
- ${AsJob},
-
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
@@ -1546,18 +1704,6 @@ param(
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Run the command asynchronously
- ${NoWait},
-
- [Parameter()]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
- [System.Management.Automation.SwitchParameter]
- # Returns true when the command succeeds
- ${PassThru},
-
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
[System.Uri]
@@ -1585,11 +1731,30 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
- Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupInstance_Delete';
- DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupInstance_DeleteViaIdentity';
+ Get = 'Az.DataProtection.private\Get-AzDataProtectionResourceGuard_Get';
+ Get1 = 'Az.DataProtection.private\Get-AzDataProtectionResourceGuard_Get1';
+ GetViaIdentity = 'Az.DataProtection.private\Get-AzDataProtectionResourceGuard_GetViaIdentity';
}
- if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
@@ -1599,6 +1764,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -1607,27 +1773,44 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
.Synopsis
-Deletes a backup policy belonging to a backup vault
+Delete a backupInstances
.Description
-Deletes a backup policy belonging to a backup vault
+Delete a backupInstances
.Example
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Remove-AzDataProtectionBackupPolicy -Name $policy[0].name -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name $instance[0].name
.Inputs
@@ -1653,17 +1836,17 @@ INPUTOBJECT : Identity Parameter
[SubscriptionId ]: The subscription Id.
[VaultName ]: The name of the backup vault.
.Link
-https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionbackuppolicy
+https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionbackupinstance
#>
-function Remove-AzDataProtectionBackupPolicy {
+function Remove-AzDataProtectionBackupInstance {
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='Delete', Mandatory)]
- [Alias('BackupPolicyName')]
+ [Alias('BackupInstanceName')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[System.String]
- # .
+ # The name of the backup instance
${Name},
[Parameter(ParameterSetName='Delete', Mandatory)]
@@ -1700,6 +1883,12 @@ param(
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
@@ -1720,6 +1909,12 @@ param(
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
@@ -1753,9 +1948,27 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
- Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupPolicy_Delete';
- DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupPolicy_DeleteViaIdentity';
+ Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupInstance_Delete';
+ DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupInstance_DeleteViaIdentity';
}
if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
@@ -1767,6 +1980,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -1775,26 +1989,44 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
.Synopsis
-Deletes a BackupVault resource from the resource group.
+Deletes a backup policy belonging to a backup vault
.Description
-Deletes a BackupVault resource from the resource group.
+Deletes a backup policy belonging to a backup vault
.Example
-PS C:\> Remove-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupPolicy -Name $policy[0].name -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Inputs
@@ -1820,12 +2052,19 @@ INPUTOBJECT : Identity Parameter
[SubscriptionId ]: The subscription Id.
[VaultName ]: The name of the backup vault.
.Link
-https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionbackupvault
+https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionbackuppolicy
#>
-function Remove-AzDataProtectionBackupVault {
+function Remove-AzDataProtectionBackupPolicy {
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('BackupPolicyName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${Name},
+
[Parameter(ParameterSetName='Delete', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[System.String]
@@ -1913,9 +2152,27 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
- Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupVault_Delete';
- DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupVault_DeleteViaIdentity';
+ Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupPolicy_Delete';
+ DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupPolicy_DeleteViaIdentity';
}
if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
@@ -1927,6 +2184,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -1935,95 +2193,1357 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
.Synopsis
-Triggers restore for a BackupInstance
+Deletes a BackupVault resource from the resource group.
.Description
-Triggers restore for a BackupInstance
-.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint $rp[0].name
-PS C:\> Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName sarath-rg -VaultName sarath-vault -SubscriptionId "xxx-xxx-xxx" -Parameter $restorerequest
-
-.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
-PS C:\> $targetResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/serverName/databases/targetDbName"
-PS C:\> $secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId $targetResourceId -RecoveryPoint $rp[0].Property.RecoveryPointId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
-PS C:\> $restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
-PS C:\> $jobid = $restoreJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
-{
- Start-Sleep -Seconds 10
- $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
- $jobstatus = $currentjob.Status
-}
-
+Deletes a BackupVault resource from the resource group.
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
-PS C:\> $targetContainerURI = ""https://targetStorageAccount.blob.core.windows.net/targetContainerName""
-PS C:\> $fileNamePrefix = "restore_as_files_12345"
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType RestoreAsFiles -RecoveryPoint $rp[0].Property.RecoveryPointId -TargetContainerURI $targetContainerURI -FileNamePrefix $fileNamePrefix
-PS C:\> $restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
-PS C:\> $jobid = $restoreJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
-{
- Start-Sleep -Seconds 10
- $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
- $jobstatus = $currentjob.Status
-}
+Remove-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Inputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo
+System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-PARAMETER : Azure backup restore request
- ObjectType :
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionbackupvault
+#>
+function Remove-AzDataProtectionBackupVault {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupVault_Delete';
+ DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupVault_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Deletes a ResourceGuard resource from the resource group.
+.Description
+Deletes a ResourceGuard resource from the resource group.
+.Example
+PS C:\> Remove-AzDataProtectionResourceGuard -Name "ResourceGuardName" -ResourceGroupName "ResourceGroupName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionresourceguard
+#>
+function Remove-AzDataProtectionResourceGuard {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of ResourceGuard
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Delete = 'Az.DataProtection.private\Remove-AzDataProtectionResourceGuard_Delete';
+ DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionResourceGuard_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+This operation will resume protection for a stopped backup instance
+.Description
+This operation will resume protection for a stopped backup instance
+.Example
+PS C:\> Resume-AzDataProtectionBackupInstanceProtection -BackupInstanceName $backupInstance.BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/resume-azdataprotectionbackupinstanceprotection
+#>
+function Resume-AzDataProtectionBackupInstanceProtection {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Resume', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Resume', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${BackupInstanceName},
+
+ [Parameter(ParameterSetName='Resume', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Resume')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Resume', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='ResumeViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Resume = 'Az.DataProtection.private\Resume-AzDataProtectionBackupInstanceProtection_Resume';
+ ResumeViaIdentity = 'Az.DataProtection.private\Resume-AzDataProtectionBackupInstanceProtection_ResumeViaIdentity';
+ }
+ if (('Resume') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Triggers restore for a BackupInstance
+.Description
+Triggers restore for a BackupInstance
+.Example
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint $rp[0].name
+Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName sarath-rg -VaultName sarath-vault -SubscriptionId "xxx-xxx-xxx" -Parameter $restorerequest
+
+.Example
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
+$targetResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/serverName/databases/targetDbName"
+$secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId $targetResourceId -RecoveryPoint $rp[0].Property.RecoveryPointId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
+$restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
+$jobid = $restoreJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
+{
+ Start-Sleep -Seconds 10
+ $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+ $jobstatus = $currentjob.Status
+}
+
+.Example
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
+$targetContainerURI = ""https://targetStorageAccount.blob.core.windows.net/targetContainerName""
+$fileNamePrefix = "restore_as_files_12345"
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType RestoreAsFiles -RecoveryPoint $rp[0].Property.RecoveryPointId -TargetContainerURI $targetContainerURI -FileNamePrefix $fileNamePrefix
+$restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
+$jobid = $restoreJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
+{
+ Start-Sleep -Seconds 10
+ $currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+ $jobstatus = $currentjob.Status
+}
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+PARAMETER : Azure backup restore request
+ ObjectType :
RestoreTargetInfo : Gets or sets the restore target information.
ObjectType : Type of Datasource object, used to initialize the right inherited type
[RestoreLocation ]: Target Restore region
SourceDataStoreType : Gets or sets the type of the source data store.
+ [SourceResourceId ]: Fully qualified Azure Resource Manager ID of the datasource which is being recovered.
+
+RESTORETARGETINFO : Gets or sets the restore target information.
+ ObjectType : Type of Datasource object, used to initialize the right inherited type
+ [RestoreLocation ]: Target Restore region
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/start-azdataprotectionbackupinstancerestore
+#>
+function Start-AzDataProtectionBackupInstanceRestore {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo])]
+[CmdletBinding(DefaultParameterSetName='Trigger', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup instance
+ ${BackupInstanceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest]
+ # Azure backup restore request
+ # To construct, see NOTES section for PARAMETER properties and create a hash table.
+ ${Parameter},
+
+ [Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # .
+ ${ObjectType},
+
+ [Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IRestoreTargetInfoBase]
+ # Gets or sets the restore target information.
+ # To construct, see NOTES section for RESTORETARGETINFO properties and create a hash table.
+ ${RestoreTargetInfo},
+
+ [Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType]
+ # Gets or sets the type of the source data store.
+ ${SourceDataStoreType},
+
+ [Parameter(ParameterSetName='TriggerExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Fully qualified Azure Resource Manager ID of the datasource which is being recovered.
+ ${SourceResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Trigger = 'Az.DataProtection.private\Start-AzDataProtectionBackupInstanceRestore_Trigger';
+ TriggerExpanded = 'Az.DataProtection.private\Start-AzDataProtectionBackupInstanceRestore_TriggerExpanded';
+ }
+ if (('Trigger', 'TriggerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+This operation will stop protection of a backup instance and data will be held forever
+.Description
+This operation will stop protection of a backup instance and data will be held forever
+.Example
+PS C:\> Stop-AzDataProtectionBackupInstanceProtection -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/stop-azdataprotectionbackupinstanceprotection
+#>
+function Stop-AzDataProtectionBackupInstanceProtection {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Stop', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Stop', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${BackupInstanceName},
+
+ [Parameter(ParameterSetName='Stop', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Stop')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Stop', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='StopViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Stop = 'Az.DataProtection.private\Stop-AzDataProtectionBackupInstanceProtection_Stop';
+ StopViaIdentity = 'Az.DataProtection.private\Stop-AzDataProtectionBackupInstanceProtection_StopViaIdentity';
+ }
+ if (('Stop') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+This operation will stop backups for backup instance
+.Description
+This operation will stop backups for backup instance
+.Example
+PS C:\> Suspend-AzDataProtectionBackupInstanceBackup -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
-RESTORETARGETINFO : Gets or sets the restore target information.
- ObjectType : Type of Datasource object, used to initialize the right inherited type
- [RestoreLocation ]: Target Restore region
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
.Link
-https://docs.microsoft.com/powershell/module/az.dataprotection/start-azdataprotectionbackupinstancerestore
+https://docs.microsoft.com/powershell/module/az.dataprotection/suspend-azdataprotectionbackupinstancebackup
#>
-function Start-AzDataProtectionBackupInstanceRestore {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo])]
-[CmdletBinding(DefaultParameterSetName='Trigger', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+function Suspend-AzDataProtectionBackupInstanceBackup {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Suspend', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
- [Parameter(Mandatory)]
+ [Parameter(ParameterSetName='Suspend', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[System.String]
- # The name of the backup instance
+ # .
${BackupInstanceName},
+ [Parameter(ParameterSetName='Suspend', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Suspend')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Suspend', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='SuspendViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Suspend = 'Az.DataProtection.private\Suspend-AzDataProtectionBackupInstanceBackup_Suspend';
+ SuspendViaIdentity = 'Az.DataProtection.private\Suspend-AzDataProtectionBackupInstanceBackup_SuspendViaIdentity';
+ }
+ if (('Suspend') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state
+.Description
+Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state
+.Example
+PS C:\> Sync-AzDataProtectionBackupInstance -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+
+.Outputs
+System.Boolean
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/sync-azdataprotectionbackupinstance
+#>
+function Sync-AzDataProtectionBackupInstance {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='SyncExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('BackupInstanceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${Name},
+
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
[System.String]
@@ -2043,32 +3563,13 @@ param(
# The subscription Id.
${SubscriptionId},
- [Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest]
- # Azure backup restore request
- # To construct, see NOTES section for PARAMETER properties and create a hash table.
- ${Parameter},
-
- [Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [System.String]
- # .
- ${ObjectType},
-
- [Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IRestoreTargetInfoBase]
- # Gets or sets the restore target information.
- # To construct, see NOTES section for RESTORETARGETINFO properties and create a hash table.
- ${RestoreTargetInfo},
-
- [Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
- [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType])]
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SyncType])]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SourceDataStoreType]
- # Gets or sets the type of the source data store.
- ${SourceDataStoreType},
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SyncType]
+ # Field indicating sync type e.g.
+ # to sync only in case of failure or in all cases
+ ${SyncType},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
@@ -2110,6 +3611,12 @@ param(
# Run the command asynchronously
${NoWait},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
[System.Uri]
@@ -2137,11 +3644,28 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
- Trigger = 'Az.DataProtection.private\Start-AzDataProtectionBackupInstanceRestore_Trigger';
- TriggerExpanded = 'Az.DataProtection.private\Start-AzDataProtectionBackupInstanceRestore_TriggerExpanded';
+ SyncExpanded = 'Az.DataProtection.private\Sync-AzDataProtectionBackupInstance_SyncExpanded';
}
- if (('Trigger', 'TriggerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ if (('SyncExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
@@ -2151,6 +3675,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2159,17 +3684,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2180,17 +3722,19 @@ For example, updating tags for a resource.
Updates a BackupVault resource belonging to a resource group.
For example, updating tags for a resource.
.Example
-PS C:\> $tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
-PS C:\> Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
+$tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
+Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
+.Example
+PS C:\> Update-AzDataProtectionBackupVault -ResourceGroupName "rgName" -VaultName "vaultName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -AzureMonitorAlertsForAllJobFailure 'Disabled'
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+Name Location Type IdentityType
+---- -------- ---- ------------
+vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -2213,7 +3757,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/update-azdataprotectionbackupvault
#>
function Update-AzDataProtectionBackupVault {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource])]
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
@@ -2242,6 +3786,14 @@ param(
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState]
+ # Parameter to Enable or Disable built-in azure monitor alerts for job failures.
+ # Security alerts cannot be disabled.
+ ${AzureMonitorAlertsForAllJobFailure},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
[System.String]
@@ -2250,7 +3802,7 @@ param(
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IPatchResourceRequestInputTags]))]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IPatchResourceRequestInputTags]))]
[System.Collections.Hashtable]
# Resource tags.
${Tag},
@@ -2322,6 +3874,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
UpdateExpanded = 'Az.DataProtection.private\Update-AzDataProtectionBackupVault_UpdateExpanded';
UpdateViaIdentityExpanded = 'Az.DataProtection.private\Update-AzDataProtectionBackupVault_UpdateViaIdentityExpanded';
@@ -2336,6 +3906,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2344,17 +3915,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2363,22 +3951,14 @@ Adds or removes Retention Rule to existing Policy
.Description
Adds or removes Retention Rule to existing Policy
.Example
-PS C:\> $pol = Get-AzDataProtectionPolicyTemplate
-PS C:\> $lifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 5
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -LifeCycles $lifecycle -IsDefault $false
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+$pol = Get-AzDataProtectionPolicyTemplate
+$lifecycle = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 5
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -LifeCycles $lifecycle -IsDefault $false
.Example
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -RemoveRule
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $pol -Name Weekly -RemoveRule
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -2418,12 +3998,12 @@ POLICY : Backup Policy Object
https://docs.microsoft.com/powershell/module/az.dataprotection/edit-azdataprotectionpolicyretentionruleclientobject
#>
function Edit-AzDataProtectionPolicyRetentionRuleClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(DefaultParameterSetName='RemoveRetention', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Backup Policy Object
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -2448,7 +4028,7 @@ param(
[Parameter(ParameterSetName='AddRetention', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle[]]
# Life cycles associated with the retention rule.
# To construct, see NOTES section for LIFECYCLES properties and create a hash table.
${LifeCycles}
@@ -2461,6 +4041,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
RemoveRetention = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyRetentionRuleClientObject';
AddRetention = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyRetentionRuleClientObject';
@@ -2472,6 +4070,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2480,17 +4079,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2499,21 +4115,13 @@ Adds or removes schedule tag in an existing backup policy.
.Description
Adds or removes schedule tag in an existing backup policy.
.Example
-PS C:\> $criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+$criteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfWeek
+Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -Criteria $criteria
.Example
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+Edit-AzDataProtectionPolicyTagClientObject -Policy $pol -Name Weekly -RemoveRule
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -2554,12 +4162,12 @@ POLICY : Backup Policy Object.
https://docs.microsoft.com/powershell/module/az.dataprotection/edit-azdataprotectionpolicytagclientobject
#>
function Edit-AzDataProtectionPolicyTagClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(DefaultParameterSetName='RemoveTag', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Backup Policy Object.
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -2578,7 +4186,7 @@ param(
[Parameter(ParameterSetName='updateTag', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria[]]
# Criterias to be associated with the schedule tag.
# To construct, see NOTES section for CRITERIA properties and create a hash table.
${Criteria}
@@ -2591,6 +4199,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
RemoveTag = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyTagClientObject';
updateTag = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyTagClientObject';
@@ -2602,6 +4228,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2610,17 +4237,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2629,15 +4273,11 @@ Updates Backup schedule of an existing backup policy.
.Description
Updates Backup schedule of an existing backup policy.
.Example
-PS C:\> $schedule = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays (get-date) -IntervalType Daily -IntervalCount 1
-PS C:\> Edit-AzDataProtectionPolicyTriggerClientObject -Policy $pol -Schedule $schedule
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+$schedule = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays (Get-Date) -IntervalType Daily -IntervalCount 1
+Edit-AzDataProtectionPolicyTriggerClientObject -Policy $pol -Schedule $schedule
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -2667,12 +4307,12 @@ POLICY : Backup Policy object.
https://docs.microsoft.com/powershell/module/az.dataprotection/edit-azdataprotectionpolicytriggerclientobject
#>
function Edit-AzDataProtectionPolicyTriggerClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Backup Policy object.
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -2691,6 +4331,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Edit-AzDataProtectionPolicyTriggerClientObject';
}
@@ -2701,6 +4359,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2709,17 +4368,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2728,19 +4404,15 @@ Gets default policy template for a selected datasource type.
.Description
Gets default policy template for a selected datasource type.
.Example
-PS C:\> Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
-
-DatasourceType ObjectType
--------------- ----------
-{Microsoft.Compute/disks} BackupPolicy
+Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionpolicytemplate
#>
function Get-AzDataProtectionPolicyTemplate {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -2757,6 +4429,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Get-AzDataProtectionPolicyTemplate';
}
@@ -2767,6 +4457,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2775,17 +4466,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2794,23 +4502,19 @@ Initializes Backup instance Request object for configuring backup
.Description
Initializes Backup instance Request object for configuring backup
.Example
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> $AzureDiskId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{diskname}"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation westus -DatasourceId $AzureDiskId -PolicyId $policy[0].Id
-PS C:\> $instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{snapshotResourceGroup}"
-PS C:\> $instance
-
-Name Type BackupInstanceName
----- ---- ------------------
- sarath-disk3-sarath-disk3-af697a80-e2bc-49f1-af6c-22f6c4d68405
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault
+$AzureDiskId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{diskname}"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation westus -DatasourceId $AzureDiskId -PolicyId $policy[0].Id
+$instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{snapshotResourceGroup}"
+$instance
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/initialize-azdataprotectionbackupinstance
#>
function Initialize-AzDataProtectionBackupInstance {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -2859,6 +4563,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Initialize-AzDataProtectionBackupInstance';
}
@@ -2869,6 +4591,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -2877,17 +4600,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -2896,54 +4636,34 @@ Initializes Restore Request object for triggering restore on a protected backup
.Description
Initializes Restore Request object for triggering restore on a protected backup instance.
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint "892e5c5014dc4a96807d22924f5745c9"
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointI
- d
----------- --------------------------- ------------------------------- -------------------------------- ------------------- --------------
-AzureBackupRecoveryPointBasedRestoreRequest RestoreTargetInfo FailIfExists westus OperationalStore 892e5c5014dc4a96807d22924f5745c9
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint "892e5c5014dc4a96807d22924f5745c9"
+$restoreRequest
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instance[0] -PointInTime (Get-Date -Date $pointInTimeRange.RestorableTimeRange.EndTime)
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
----------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
-AzureBackupRecoveryTimeBasedRestoreRequest restoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-24T13:32:41.7018481Z
-
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instance[0] -PointInTime (Get-Date -Date $pointInTimeRange.RestorableTimeRange.EndTime)
+$restoreRequest
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -ContainersList "containerName1","containerName2"
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
----------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
-AzureBackupRecoveryTimeBasedRestoreRequest itemLevelRestoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-23T02:47:02.9500000Z
-
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -ContainersList "containerName1","containerName2"
+$restoreRequest
.Example
-PS C:\> $startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
-PS C:\> $pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -FromPrefixPattern "container1/aaa","container1/ccc", "container2/aab", "container3" -ToPrefixPattern "container1/bbb","container1/ddd", "container2/abc", "container3-0"
-PS C:\> $restoreRequest
-
-ObjectType RestoreTargetInfoObjectType RestoreTargetInfoRecoveryOption RestoreTargetInfoRestoreLocation SourceDataStoreType RecoveryPointTime
----------- --------------------------- ------------------------------- -------------------------------- ------------------- -----------------
-AzureBackupRecoveryTimeBasedRestoreRequest itemLevelRestoreTargetInfo FailIfExists eastus2euap OperationalStore 2021-04-23T02:47:02.9500000Z
-
+$startTime = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$endTime = (Get-Date).AddDays(0).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "rgName" -VaultName "vaultName"
+$pointInTimeRange = Find-AzDataProtectionRestorableTimeRange -BackupInstanceName $instance[0].BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "subscriptionId" -VaultName "vaultName" -SourceDataStoreType OperationalStore -StartTime $startTime -EndTime $endTime
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureBlob -SourceDataStore OperationalStore -RestoreLocation $vault.Location -RestoreType OriginalLocation -BackupInstance $instances[0] -PointInTime (Get-Date).AddDays(-1) -ItemLevelRecovery -FromPrefixPattern "container1/aaa","container1/ccc", "container2/aab", "container3" -ToPrefixPattern "container1/bbb","container1/ddd", "container2/abc", "container3-0"
+$restoreRequest
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -2977,11 +4697,12 @@ BACKUPINSTANCE : Backup Instance object to trigger origi
[DatasourceAuthCredentials ]: Credentials to use to authenticate with data source provider.
ObjectType : Type of the specific object - used for deserializing
[FriendlyName ]: Gets or sets the Backup Instance friendly name.
+ [ValidationType ]: Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again.
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/initialize-azdataprotectionrestorerequest
#>
function Initialize-AzDataProtectionRestoreRequest {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest])]
[CmdletBinding(DefaultParameterSetName='AlternateLocationFullRecovery', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -3056,7 +4777,7 @@ param(
[Parameter(ParameterSetName='OriginalLocationILR', Mandatory)]
[Parameter(ParameterSetName='OriginalLocationFullRecovery', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource]
# Backup Instance object to trigger original localtion restore.
# To construct, see NOTES section for BACKUPINSTANCE properties and create a hash table.
${BackupInstance},
@@ -3107,6 +4828,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
RestoreAsFiles = 'Az.DataProtection.custom\Initialize-AzDataProtectionRestoreRequest';
OriginalLocationILR = 'Az.DataProtection.custom\Initialize-AzDataProtectionRestoreRequest';
@@ -3120,6 +4859,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3128,17 +4868,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -3147,30 +4904,20 @@ Configures Backup for supported azure resources
.Description
Configures Backup for supported azure resources
.Example
-PS C:\> $sub = "xxxx-xxx-xx"
-PS C:\> $DiskId = "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{diskname}"
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $DiskId
-PS C:\> $instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}"
-PS C:\> New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstance $instance
-
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 Microsoft.DataProtection/backupVaults/backupInstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166
+$sub = "xxxx-xxx-xx"
+$DiskId = "/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{diskname}"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDisk -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $DiskId
+$instance.Property.PolicyInfo.PolicyParameter.DataStoreParametersList[0].ResourceGroupId = "/subscriptions/{subscription}/resourceGroups/{resourceGroup}"
+New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstance $instance
.Example
-PS C:\> $sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
-PS C:\> $dataSourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/OssServerName/databases/DBName"
-PS C:\> $secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
-PS C:\> $vault = Get-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName $vaultName
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -Name "MyPolicy"
-PS C:\> $instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDatabaseForPostgreSQL -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $dataSourceId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
-PS C:\> New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -BackupInstance $instance
-
-Name Type BackupInstanceName
----- ---- ------------------
-xyz-postgresql-wus-empdb10-xxxxxxxx-xxxx-xxxx-a3ba-be75108d8b21 Microsoft.DataProtection/backupVaults/backupInstances xyz-postgresql-wus-empdb10-xxxxxxxx-xxxx-xxxx-a3ba-be75108d8b21
-
+$sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
+$dataSourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/OssServerName/databases/DBName"
+$secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
+$vault = Get-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName $vaultName
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -Name "MyPolicy"
+$instance = Initialize-AzDataProtectionBackupInstance -DatasourceType AzureDatabaseForPostgreSQL -DatasourceLocation $vault.Location -PolicyId $policy.Id -DatasourceId $dataSourceId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
+New-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName "ResourceGroupName" -VaultName "vaultName" -BackupInstance $instance
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -3205,6 +4952,7 @@ BACKUPINSTANCE : Backup instance request object which w
[DatasourceAuthCredentials ]: Credentials to use to authenticate with data source provider.
ObjectType : Type of the specific object - used for deserializing
[FriendlyName ]: Gets or sets the Backup Instance friendly name.
+ [ValidationType ]: Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again.
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionbackupinstance
#>
@@ -3225,7 +4973,7 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource]
# Backup instance request object which will be used to configure backup
# To construct, see NOTES section for BACKUPINSTANCE properties and create a hash table.
${BackupInstance},
@@ -3294,6 +5042,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupInstance';
}
@@ -3304,6 +5070,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3312,17 +5079,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -3331,18 +5115,14 @@ Creates a new backup policy in a given backup vault
.Description
Creates a new backup policy in a given backup vault
.Example
-PS C:\> $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
-PS C:\> New-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy" -Policy $defaultPol
-
-Name Type
----- ----
-MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDisk
+New-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Name "MyPolicy" -Policy $defaultPol
.Example
-PS C:\> $defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL
-PS C:\> $lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 3 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
-PS C:\> $lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $true
-PS C:\> $schDates = @(
+$defaultPol = Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL
+$lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 3 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
+$lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Default -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $true
+$schDates = @(
(
(Get-Date -Year 2021 -Month 08 -Day 18 -Hour 10 -Minute 0 -Second 0)
),
@@ -3350,22 +5130,17 @@ PS C:\> $schDates = @(
(Get-Date -Year 2021 -Month 08 -Day 22 -Hour 10 -Minute 0 -Second 0)
))
-PS C:\> $trigger = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $schDates -IntervalType Weekly -IntervalCount 1
-PS C:\> Edit-AzDataProtectionPolicyTriggerClientObject -Schedule $trigger -Policy $defaultPol
-PS C:\> $lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
-PS C:\> $lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 12
-PS C:\> Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Monthly -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $false
-PS C:\> $tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfMonth
-PS C:\> Edit-AzDataProtectionPolicyTagClientObject -Policy $defaultPol -Name Monthly -Criteria $tagCriteria
-PS C:\> New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "MyPolicy" -Policy $defaultPol
-
-
-Name Type
----- ----
-MyPolicy Microsoft.DataProtection/backupVaults/backupPolicies
+$trigger = New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $schDates -IntervalType Weekly -IntervalCount 1
+Edit-AzDataProtectionPolicyTriggerClientObject -Schedule $trigger -Policy $defaultPol
+$lifeCycleVault = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore VaultStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 6 -TargetDataStore ArchiveStore -CopyOption CopyOnExpiryOption
+$lifeCycleArchive = New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore ArchiveStore -SourceRetentionDurationType Months -SourceRetentionDurationCount 12
+Edit-AzDataProtectionPolicyRetentionRuleClientObject -Policy $defaultPol -Name Monthly -LifeCycles $lifeCycleVault, $lifeCycleArchive -IsDefault $false
+$tagCriteria = New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfMonth
+Edit-AzDataProtectionPolicyTagClientObject -Policy $defaultPol -Name Monthly -Criteria $tagCriteria
+New-AzDataProtectionBackupPolicy -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Name "MyPolicy" -Policy $defaultPol
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -3395,7 +5170,7 @@ POLICY : Policy Request Object
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionbackuppolicy
#>
function New-AzDataProtectionBackupPolicy {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBaseBackupPolicyResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBaseBackupPolicyResource])]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -3418,7 +5193,7 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupPolicy]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupPolicy]
# Policy Request Object
# To construct, see NOTES section for POLICY properties and create a hash table.
${Policy},
@@ -3477,6 +5252,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupPolicy';
}
@@ -3487,6 +5280,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3495,17 +5289,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -3514,13 +5325,9 @@ Creates or updates a BackupVault resource belonging to a resource group.
.Description
Creates or updates a BackupVault resource belonging to a resource group.
.Example
-PS C:\> $sub = "xxxx-xxxx-xxxxx"
-PS C:\> $storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
-PS C:\> New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus
-
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- westus MyVault Microsoft.DataProtection/backupVaults
+$sub = "xxxx-xxxx-xxxxx"
+$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
+New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus
.Outputs
System.Management.Automation.PSObject
@@ -3559,7 +5366,7 @@ param(
[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IStorageSetting[]]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IStorageSetting[]]
# Storage Settings of the vault.
# Use New-AzDataProtectionBackupVaultStorageSetting Cmdlet to Create.
# To construct, see NOTES section for STORAGESETTING properties and create a hash table.
@@ -3583,6 +5390,13 @@ param(
# The identityType which can be either SystemAssigned or None.
${IdentityType},
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState]
+ # Parameter to Enable or Disable built-in azure monitor alerts for job failures.
+ # Security alerts cannot be disabled.
+ ${AzureMonitorAlertsForAllJobFailure},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
[System.Collections.Hashtable]
@@ -3647,6 +5461,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupVault';
}
@@ -3657,6 +5489,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3665,17 +5498,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -3684,11 +5534,7 @@ Get Backup Vault storage setting object
.Description
Get Backup Vault storage setting object
.Example
-PS C:\> New-AzDataProtectionBackupVaultStorageSettingObject -Type GeoRedundant -DataStoreType VaultStore
-
-DatastoreType Type
-------------- ----
-VaultStore GeoRedundant
+New-AzDataProtectionBackupVaultStorageSettingObject -Type GeoRedundant -DataStoreType VaultStore
.Outputs
System.Management.Automation.PSObject
@@ -3719,6 +5565,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionBackupVaultStorageSettingObject';
}
@@ -3729,6 +5593,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3737,17 +5602,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -3756,25 +5638,17 @@ Creates a new criteria object
.Description
Creates a new criteria object
.Example
-PS C:\> New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfDay
-
-ObjectType AbsoluteCriterion DaysOfTheWeek MonthsOfYear ScheduleTime WeeksOfTheMonth
----------- ----------------- ------------- ------------ ------------ ---------------
-ScheduleBasedBackupCriteria {FirstOfDay}
+New-AzDataProtectionPolicyTagCriteriaClientObject -AbsoluteCriteria FirstOfDay
.Example
-PS C:\> New-AzDataProtectionPolicyTagCriteriaClientObject -DaysOfWeek @("Sunday", "Monday")
-
-ObjectType AbsoluteCriterion DaysOfTheWeek MonthsOfYear ScheduleTime WeeksOfTheMonth
----------- ----------------- ------------- ------------ ------------ ---------------
-ScheduleBasedBackupCriteria {Sunday, Monday}
+New-AzDataProtectionPolicyTagCriteriaClientObject -DaysOfWeek @("Sunday", "Monday")
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionpolicytagcriteriaclientobject
#>
function New-AzDataProtectionPolicyTagCriteriaClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IScheduleBasedBackupCriteria])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IScheduleBasedBackupCriteria])]
[CmdletBinding(DefaultParameterSetName='ScheduleCriteria', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='AbsoluteCriteria', Mandatory)]
@@ -3824,6 +5698,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
AbsoluteCriteria = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTagCriteriaClientObject';
ScheduleCriteria = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTagCriteriaClientObject';
@@ -3836,6 +5728,121 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Creates new Schedule object
+.Description
+Creates new Schedule object
+.Example
+$date = Get-Date
+New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Daily -IntervalCount 1
+.Example
+$date = Get-Date
+New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Hourly -IntervalCount 4
+
+.Outputs
+System.String[]
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionpolicytriggerscheduleclientobject
+#>
+function New-AzDataProtectionPolicyTriggerScheduleClientObject {
+[OutputType([System.String[]])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.DateTime[]]
+ # Days with which backup will be scheduled.
+ ${ScheduleDays},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.BackupFrequency]
+ # Freuquency of the backup.
+ ${IntervalType},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Int32]
+ # Frequency of the backup.
+ ${IntervalCount}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTriggerScheduleClientObject';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3844,61 +5851,134 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
+}
}
-end {
- try {
- $steppablePipeline.End()
- } catch {
- throw
- }
-}
-}
+<#
+.Synopsis
+Creates a resource guard under a resource group
+.Description
+Creates a resource guard under a resource group
+.Example
+PS C:\> New-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "mua-rg" -Name "mua-resource-guard" -Location "centraluseuap"
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionresourceguard
+#>
+function New-AzDataProtectionResourceGuard {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource])]
+[CmdletBinding(DefaultParameterSetName='CreateResourceGuard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Resource Group name of the resource guard
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Name of the resource guard
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Location of the resource guard
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Subscription Id of the resource guard
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Optional ETag
+ ${ETag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # The IdentityType to be added to the resource guard, example: SystemAssigned, None
+ ${IdentityType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSObject]
+ ${DefaultProfile},
-<#
-.Synopsis
-Creates new Schedule object
-.Description
-Creates new Schedule object
-.Example
-PS C:\> $date = get-date
-PS C:\> New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Daily -IntervalCount 1
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${Break},
-R/2021-03-03T12:49:55+05:30/P1D
-.Example
-PS C:\> $date = get-date
-PS C:\> New-AzDataProtectionPolicyTriggerScheduleClientObject -ScheduleDays $date -IntervalType Hourly -IntervalCount 4
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelineAppend},
-R/2021-03-03T12:49:55+05:30/PT4H
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelinePrepend},
-.Outputs
-System.String[]
-.Link
-https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionpolicytriggerscheduleclientobject
-#>
-function New-AzDataProtectionPolicyTriggerScheduleClientObject {
-[OutputType([System.String[]])]
-[CmdletBinding(PositionalBinding=$false)]
-param(
- [Parameter(Mandatory)]
+ [Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [System.DateTime[]]
- # Days with which backup will be scheduled.
- ${ScheduleDays},
+ [System.Uri]
+ ${Proxy},
- [Parameter(Mandatory)]
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.BackupFrequency]
- # Freuquency of the backup.
- ${IntervalType},
+ [System.Management.Automation.PSCredential]
+ ${ProxyCredential},
- [Parameter(Mandatory)]
+ [Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [System.Int32]
- # Frequency of the backup.
- ${IntervalCount}
+ [System.Management.Automation.SwitchParameter]
+ ${ProxyUseDefaultCredentials}
)
begin {
@@ -3908,8 +5988,26 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
- __AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionPolicyTriggerScheduleClientObject';
+ CreateResourceGuard = 'Az.DataProtection.custom\New-AzDataProtectionResourceGuard';
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
@@ -3918,6 +6016,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -3926,17 +6025,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -3945,29 +6061,17 @@ Creates new Lifecycle object
.Description
Creates new Lifecycle object
.Example
-PS C:\> New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30
-
-DeleteAfterDuration : P30D
-DeleteAfterObjectType : AbsoluteDeleteOption
-SourceDataStoreObjectType : DataStoreInfoBase
-SourceDataStoreType : OperationalStore
-TargetDataStoreCopySetting :
+New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Days -SourceRetentionDurationCount 30
.Example
-PS C:\> New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 20
-
-DeleteAfterDuration : P20W
-DeleteAfterObjectType : AbsoluteDeleteOption
-SourceDataStoreObjectType : DataStoreInfoBase
-SourceDataStoreType : OperationalStore
-TargetDataStoreCopySetting :
+New-AzDataProtectionRetentionLifeCycleClientObject -SourceDataStore OperationalStore -SourceRetentionDurationType Weeks -SourceRetentionDurationCount 20
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/new-azdataprotectionretentionlifecycleclientobject
#>
function New-AzDataProtectionRetentionLifeCycleClientObject {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ISourceLifeCycle])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ISourceLifeCycle])]
[CmdletBinding(PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
@@ -4008,6 +6112,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\New-AzDataProtectionRetentionLifeCycleClientObject';
}
@@ -4018,6 +6140,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -4026,17 +6149,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -4045,34 +6185,11 @@ Searches for Backup instances in Azure Resource Graph and retrieves the expected
.Description
Searches for Backup instances in Azure Resource Graph and retrieves the expected entries
.Example
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk
-
-Name Type
----- ----
-ContosoDemoVM_DataDisk_0-ContosoDemoVM_DataDisk_0-5f7b2a1f-f1ab-4abe-aadf-e7dc48238157 microsoft.dataprotection/backupvaults/backupinstance
-ContosoDemoVM_OsDisk_1_84b542ec38a447cea-ContosoDemoVM_OsDisk_1_84b542ec38a447cea-9bdcbd90-3555-4651-93b8-8265e1b5c07a microsoft.dataprotection/backupvaults/backupinstance
-DataDisk1-DataDisk1-0c71e6bf-9289-483c-8e27-aa6c0df60078 microsoft.dataprotection/backupvaults/backupinstance
-rraj-StandardHDD-rraj-StandardHDD-85d0a3f4-7fa8-46c7-bf83-0dee27eac08e microsoft.dataprotection/backupvaults/backupinstance
-sakaarhotfixtest_disk1_86d713f7b80e493b9-sakaarhotfixtest_disk1_86d713f7b80e493b9-be214c89-c07d-41f0-8362-b78d58d5506f microsoft.dataprotection/backupvaults/backupinstance
-pracdisk-pracdisk-643fac7d-0816-4056-8908-d0ef8b63b047 microsoft.dataprotection/backupvaults/backupinstance
-test1-test1-59f95871-de81-4051-95e7-ee6c4e5b30e0 microsoft.dataprotection/backupvaults/backupinstance
-anubhwus-test-anubhwus-test-5fe6ce14-fbd2-4641-80d0-f8f8b254601d microsoft.dataprotection/backupvaults/backupinstance
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk
.Example
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2")
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea74df26d4a8 microsoft.dataprotection/backupvaults/backupinstances sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea7
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 microsoft.dataprotection/backupvaults/backupinstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e59
-sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6bad4305a microsoft.dataprotection/backupvaults/backupinstances sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6b
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2")
.Example
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2") -ProtectionStatus ProtectionConfigured
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea74df26d4a8 microsoft.dataprotection/backupvaults/backupinstances sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea7
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 microsoft.dataprotection/backupvaults/backupinstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e59
-sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6bad4305a microsoft.dataprotection/backupvaults/backupinstances sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6b
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2") -ProtectionStatus ProtectionConfigured
.Outputs
System.Management.Automation.PSObject
@@ -4121,6 +6238,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Search-AzDataProtectionBackupInstanceInAzGraph';
}
@@ -4131,6 +6266,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -4139,17 +6275,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -4158,23 +6311,11 @@ Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entr
.Description
Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entries
.Example
-PS C:\> $endtime = get-date
-PS C:\> $starttime = $endtime.AddHours(-5)
-PS C:\> Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime
-
-Name Type
----- ----
-1c1d56c2-b21a-4038-ba46-3c1a0089e66a microsoft.dataprotection/backupvaults/backupjobs
-79f2804d-a39d-487e-91b5-f2eceffcbb7a microsoft.dataprotection/backupvaults/backupjobs
-96238abd-6ff3-48e0-8c07-0eabd6928a17 microsoft.dataprotection/backupvaults/backupjobs
+$endtime = Get-Date
+$starttime = $endtime.AddHours(-5)
+Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime
.Example
-PS C:\> Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup
-
-Name Type
----- ----
-11bc277d-9448-446a-9e79-4721858524d6 microsoft.dataprotection/backupvaults/backupjobs
-16d7b56a-e169-41d1-aa10-cafcc19c8e12 microsoft.dataprotection/backupvaults/backupjobs
-1b0b17e3-398f-4265-9d03-ffc1e21fa73a microsoft.dataprotection/backupvaults/backupjobs
+Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup
.Outputs
System.Management.Automation.PSObject
@@ -4241,6 +6382,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Search-AzDataProtectionJobInAzGraph';
}
@@ -4251,6 +6410,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -4259,17 +6419,34 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
<#
@@ -4278,22 +6455,18 @@ Updates associated policy for a given backup instance
.Description
Updates associated policy for a given backup instance
.Example
-PS C:\> $sub = "xxxx-xxxx-xxxx"
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Update-AzDataProtectionBackupInstanceAssociatedPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[0].Name -PolicyId $policy[1].Id
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk2-sarathdisk2-2ba3c708-3648-45e2-809d-9f75e66d404f Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-2ba3c708-3648-45e2-809d-9f75e66
+$sub = "xxxx-xxxx-xxxx"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
+Update-AzDataProtectionBackupInstanceAssociatedPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[0].Name -PolicyId $policy[1].Id
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/update-azdataprotectionbackupinstanceassociatedpolicy
#>
function Update-AzDataProtectionBackupInstanceAssociatedPolicy {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource])]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -4384,6 +6557,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Update-AzDataProtectionBackupInstanceAssociatedPolicy';
}
@@ -4394,6 +6585,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -4402,15 +6594,210 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Updates a resource guard belonging to a resource group
+.Description
+Updates a resource guard belonging to a resource group
+.Example
+PS C:\> $resourceGuard = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "rgName" -Name "resGuardName"
+PS C:\> $criticalOperations = $resourceGuard.ResourceGuardOperation.VaultCriticalOperation
+PS C:\> $operationsToBeExcluded = $criticalOperations | where { $_ -match "backupSecurityPIN/action" -or $_ -match "backupInstances/delete" }
+PS C:\> Update-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "rgName" -Name $resourceGuard.Name -CriticalOperationExclusionList $operationsToBeExcluded
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/update-azdataprotectionresourceguard
+#>
+function Update-AzDataProtectionResourceGuard {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource])]
+[CmdletBinding(DefaultParameterSetName='UpdateResourceGuardOperations', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Resource Group name of the resource guard
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Name of the resource guard
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Subscription Id of the resource guard
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Optional ETag
+ ${ETag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # The identityType to be updated in resource guard, example: SystemAssigned, None
+ ${IdentityType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String[]]
+ # List of critical operations which are not protected by this resourceGuard.
+ # Supported values are DeleteProtection, UpdateProtection, UpdatePolicy, GetSecurityPin
+ ${CriticalOperationExclusionList},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSObject]
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Uri]
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSCredential]
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ UpdateResourceGuardOperations = 'Az.DataProtection.custom\Update-AzDataProtectionResourceGuard';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
}
diff --git a/src/DataProtection/exports/Remove-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/exports/Remove-AzDataProtectionBackupInstance.ps1
index d16dad7e4f34..7132936d43c4 100644
--- a/src/DataProtection/exports/Remove-AzDataProtectionBackupInstance.ps1
+++ b/src/DataProtection/exports/Remove-AzDataProtectionBackupInstance.ps1
@@ -20,8 +20,8 @@ Delete a backupInstances
.Description
Delete a backupInstances
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Remove-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name $instance[0].name
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault" -Name $instance[0].name
.Inputs
@@ -159,6 +159,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupInstance_Delete';
DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupInstance_DeleteViaIdentity';
@@ -173,6 +191,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -181,15 +200,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Remove-AzDataProtectionBackupPolicy.ps1 b/src/DataProtection/exports/Remove-AzDataProtectionBackupPolicy.ps1
index 38db0336083b..c0c340460384 100644
--- a/src/DataProtection/exports/Remove-AzDataProtectionBackupPolicy.ps1
+++ b/src/DataProtection/exports/Remove-AzDataProtectionBackupPolicy.ps1
@@ -20,8 +20,8 @@ Deletes a backup policy belonging to a backup vault
.Description
Deletes a backup policy belonging to a backup vault
.Example
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
-PS C:\> Remove-AzDataProtectionBackupPolicy -Name $policy[0].name -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupPolicy -Name $policy[0].name -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Inputs
@@ -147,6 +147,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupPolicy_Delete';
DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupPolicy_DeleteViaIdentity';
@@ -161,6 +179,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -169,15 +188,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Remove-AzDataProtectionBackupVault.ps1 b/src/DataProtection/exports/Remove-AzDataProtectionBackupVault.ps1
index 8c146757905e..b5e6a8aa7ff9 100644
--- a/src/DataProtection/exports/Remove-AzDataProtectionBackupVault.ps1
+++ b/src/DataProtection/exports/Remove-AzDataProtectionBackupVault.ps1
@@ -20,7 +20,7 @@ Deletes a BackupVault resource from the resource group.
.Description
Deletes a BackupVault resource from the resource group.
.Example
-PS C:\> Remove-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
+Remove-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "MyResourceGroup" -VaultName "MyVault"
.Inputs
@@ -139,6 +139,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Delete = 'Az.DataProtection.private\Remove-AzDataProtectionBackupVault_Delete';
DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionBackupVault_DeleteViaIdentity';
@@ -153,6 +171,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -161,15 +180,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Remove-AzDataProtectionResourceGuard.ps1 b/src/DataProtection/exports/Remove-AzDataProtectionResourceGuard.ps1
new file mode 100644
index 000000000000..79dbcaae6b1a
--- /dev/null
+++ b/src/DataProtection/exports/Remove-AzDataProtectionResourceGuard.ps1
@@ -0,0 +1,210 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Deletes a ResourceGuard resource from the resource group.
+.Description
+Deletes a ResourceGuard resource from the resource group.
+.Example
+PS C:\> Remove-AzDataProtectionResourceGuard -Name "ResourceGuardName" -ResourceGroupName "ResourceGroupName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/remove-azdataprotectionresourceguard
+#>
+function Remove-AzDataProtectionResourceGuard {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of ResourceGuard
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Delete = 'Az.DataProtection.private\Remove-AzDataProtectionResourceGuard_Delete';
+ DeleteViaIdentity = 'Az.DataProtection.private\Remove-AzDataProtectionResourceGuard_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/Resume-AzDataProtectionBackupInstanceProtection.ps1 b/src/DataProtection/exports/Resume-AzDataProtectionBackupInstanceProtection.ps1
new file mode 100644
index 000000000000..3e8d2444dae0
--- /dev/null
+++ b/src/DataProtection/exports/Resume-AzDataProtectionBackupInstanceProtection.ps1
@@ -0,0 +1,228 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+This operation will resume protection for a stopped backup instance
+.Description
+This operation will resume protection for a stopped backup instance
+.Example
+PS C:\> Resume-AzDataProtectionBackupInstanceProtection -BackupInstanceName $backupInstance.BackupInstanceName -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName"
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/resume-azdataprotectionbackupinstanceprotection
+#>
+function Resume-AzDataProtectionBackupInstanceProtection {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Resume', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Resume', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${BackupInstanceName},
+
+ [Parameter(ParameterSetName='Resume', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Resume')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Resume', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='ResumeViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Resume = 'Az.DataProtection.private\Resume-AzDataProtectionBackupInstanceProtection_Resume';
+ ResumeViaIdentity = 'Az.DataProtection.private\Resume-AzDataProtectionBackupInstanceProtection_ResumeViaIdentity';
+ }
+ if (('Resume') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/Search-AzDataProtectionBackupInstanceInAzGraph.ps1 b/src/DataProtection/exports/Search-AzDataProtectionBackupInstanceInAzGraph.ps1
index 0c474458aaa0..0684aa81df51 100644
--- a/src/DataProtection/exports/Search-AzDataProtectionBackupInstanceInAzGraph.ps1
+++ b/src/DataProtection/exports/Search-AzDataProtectionBackupInstanceInAzGraph.ps1
@@ -20,34 +20,11 @@ Searches for Backup instances in Azure Resource Graph and retrieves the expected
.Description
Searches for Backup instances in Azure Resource Graph and retrieves the expected entries
.Example
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk
-
-Name Type
----- ----
-ContosoDemoVM_DataDisk_0-ContosoDemoVM_DataDisk_0-5f7b2a1f-f1ab-4abe-aadf-e7dc48238157 microsoft.dataprotection/backupvaults/backupinstance
-ContosoDemoVM_OsDisk_1_84b542ec38a447cea-ContosoDemoVM_OsDisk_1_84b542ec38a447cea-9bdcbd90-3555-4651-93b8-8265e1b5c07a microsoft.dataprotection/backupvaults/backupinstance
-DataDisk1-DataDisk1-0c71e6bf-9289-483c-8e27-aa6c0df60078 microsoft.dataprotection/backupvaults/backupinstance
-rraj-StandardHDD-rraj-StandardHDD-85d0a3f4-7fa8-46c7-bf83-0dee27eac08e microsoft.dataprotection/backupvaults/backupinstance
-sakaarhotfixtest_disk1_86d713f7b80e493b9-sakaarhotfixtest_disk1_86d713f7b80e493b9-be214c89-c07d-41f0-8362-b78d58d5506f microsoft.dataprotection/backupvaults/backupinstance
-pracdisk-pracdisk-643fac7d-0816-4056-8908-d0ef8b63b047 microsoft.dataprotection/backupvaults/backupinstance
-test1-test1-59f95871-de81-4051-95e7-ee6c4e5b30e0 microsoft.dataprotection/backupvaults/backupinstance
-anubhwus-test-anubhwus-test-5fe6ce14-fbd2-4641-80d0-f8f8b254601d microsoft.dataprotection/backupvaults/backupinstance
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk
.Example
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2")
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea74df26d4a8 microsoft.dataprotection/backupvaults/backupinstances sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea7
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 microsoft.dataprotection/backupvaults/backupinstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e59
-sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6bad4305a microsoft.dataprotection/backupvaults/backupinstances sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6b
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2")
.Example
-PS C:\> Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2") -ProtectionStatus ProtectionConfigured
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea74df26d4a8 microsoft.dataprotection/backupvaults/backupinstances sarath-disk3-sarath-disk3-dbb8c2d0-bdbf-448c-9664-ea7
-sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e594f166 microsoft.dataprotection/backupvaults/backupinstances sarathdisk-sarathdisk-3df6ac08-9496-4839-8fb5-8b78e59
-sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6bad4305a microsoft.dataprotection/backupvaults/backupinstances sarathdisk2-sarathdisk2-b0bf31ab-c9c5-407f-98a2-3ad6b
+Search-AzDataProtectionBackupInstanceInAzGraph -Subscription "xxxx-xxx-xxx" -DatasourceType AzureDisk -ResourceGroup @("sarath-rg", "sarath-rg2") -ProtectionStatus ProtectionConfigured
.Outputs
System.Management.Automation.PSObject
@@ -96,6 +73,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Search-AzDataProtectionBackupInstanceInAzGraph';
}
@@ -106,6 +101,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -114,15 +110,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Search-AzDataProtectionJobInAzGraph.ps1 b/src/DataProtection/exports/Search-AzDataProtectionJobInAzGraph.ps1
index 2f85b9205ba9..287390274865 100644
--- a/src/DataProtection/exports/Search-AzDataProtectionJobInAzGraph.ps1
+++ b/src/DataProtection/exports/Search-AzDataProtectionJobInAzGraph.ps1
@@ -20,23 +20,11 @@ Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entr
.Description
Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entries
.Example
-PS C:\> $endtime = get-date
-PS C:\> $starttime = $endtime.AddHours(-5)
-PS C:\> Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime
-
-Name Type
----- ----
-1c1d56c2-b21a-4038-ba46-3c1a0089e66a microsoft.dataprotection/backupvaults/backupjobs
-79f2804d-a39d-487e-91b5-f2eceffcbb7a microsoft.dataprotection/backupvaults/backupjobs
-96238abd-6ff3-48e0-8c07-0eabd6928a17 microsoft.dataprotection/backupvaults/backupjobs
+$endtime = Get-Date
+$starttime = $endtime.AddHours(-5)
+Search-AzDataProtectionJobInAzGraph -Subscription "xxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -StartTime $starttime -EndTime $endtime
.Example
-PS C:\> Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup
-
-Name Type
----- ----
-11bc277d-9448-446a-9e79-4721858524d6 microsoft.dataprotection/backupvaults/backupjobs
-16d7b56a-e169-41d1-aa10-cafcc19c8e12 microsoft.dataprotection/backupvaults/backupjobs
-1b0b17e3-398f-4265-9d03-ffc1e21fa73a microsoft.dataprotection/backupvaults/backupjobs
+Search-AzDataProtectionJobInAzGraph -Subscription "xxxx-xxx-xxx" -ResourceGroup sarath-rg -Vault sarath-vault -DatasourceType AzureDisk -Operation OnDemandBackup
.Outputs
System.Management.Automation.PSObject
@@ -103,6 +91,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Search-AzDataProtectionJobInAzGraph';
}
@@ -113,6 +119,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -121,15 +128,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Start-AzDataProtectionBackupInstanceRestore.ps1 b/src/DataProtection/exports/Start-AzDataProtectionBackupInstanceRestore.ps1
index 456c0448f162..b15473c5193f 100644
--- a/src/DataProtection/exports/Start-AzDataProtectionBackupInstanceRestore.ps1
+++ b/src/DataProtection/exports/Start-AzDataProtectionBackupInstanceRestore.ps1
@@ -20,21 +20,21 @@ Triggers restore for a BackupInstance
.Description
Triggers restore for a BackupInstance
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint $rp[0].name
-PS C:\> Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName sarath-rg -VaultName sarath-vault -SubscriptionId "xxx-xxx-xxx" -Parameter $restorerequest
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName "sarath-rg" -VaultName "sarath-vault" -BackupInstanceName $instance.Name
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDisk -SourceDataStore OperationalStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{DiskName}" -RecoveryPoint $rp[0].name
+Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName sarath-rg -VaultName sarath-vault -SubscriptionId "xxx-xxx-xxx" -Parameter $restorerequest
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
-PS C:\> $targetResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/serverName/databases/targetDbName"
-PS C:\> $secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId $targetResourceId -RecoveryPoint $rp[0].Property.RecoveryPointId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
-PS C:\> $restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
-PS C:\> $jobid = $restoreJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
+$targetResourceId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/serverName/databases/targetDbName"
+$secretURI = "https://oss-keyvault.vault.azure.net/secrets/oss-secret"
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType AlternateLocation -TargetResourceId $targetResourceId -RecoveryPoint $rp[0].Property.RecoveryPointId -SecretStoreURI $secretURI -SecretStoreType AzureKeyVault
+$restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
+$jobid = $restoreJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
{
Start-Sleep -Seconds 10
$currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
@@ -42,15 +42,15 @@ PS C:\> while($jobstatus -ne "Completed")
}
.Example
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
-PS C:\> $rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
-PS C:\> $targetContainerURI = ""https://targetStorageAccount.blob.core.windows.net/targetContainerName""
-PS C:\> $fileNamePrefix = "restore_as_files_12345"
-PS C:\> $restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType RestoreAsFiles -RecoveryPoint $rp[0].Property.RecoveryPointId -TargetContainerURI $targetContainerURI -FileNamePrefix $fileNamePrefix
-PS C:\> $restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
-PS C:\> $jobid = $restoreJob.JobId.Split("/")[-1]
-PS C:\> $jobstatus = "InProgress"
-PS C:\> while($jobstatus -ne "Completed")
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
+$rp = Get-AzDataProtectionRecoveryPoint -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -BackupInstanceName $instance.Name
+$targetContainerURI = ""https://targetStorageAccount.blob.core.windows.net/targetContainerName""
+$fileNamePrefix = "restore_as_files_12345"
+$restoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureDatabaseForPostgreSQL -SourceDataStore VaultStore -RestoreLocation "westus" -RestoreType RestoreAsFiles -RecoveryPoint $rp[0].Property.RecoveryPointId -TargetContainerURI $targetContainerURI -FileNamePrefix $fileNamePrefix
+$restoreJob = Start-AzDataProtectionBackupInstanceRestore -BackupInstanceName $instance.BackupInstanceName -ResourceGroupName resourceGroupName -VaultName vaultName -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Parameter $restorerequest
+$jobid = $restoreJob.JobId.Split("/")[-1]
+$jobstatus = "InProgress"
+while($jobstatus -ne "Completed")
{
Start-Sleep -Seconds 10
$currentjob = Get-AzDataProtectionJob -Id $jobid -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName"
@@ -59,9 +59,9 @@ PS C:\> while($jobstatus -ne "Completed")
.Inputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -73,6 +73,7 @@ PARAMETER : Azure backup restore request
ObjectType : Type of Datasource object, used to initialize the right inherited type
[RestoreLocation ]: Target Restore region
SourceDataStoreType : Gets or sets the type of the source data store.
+ [SourceResourceId ]: Fully qualified Azure Resource Manager ID of the datasource which is being recovered.
RESTORETARGETINFO : Gets or sets the restore target information.
ObjectType : Type of Datasource object, used to initialize the right inherited type
@@ -81,7 +82,7 @@ RESTORETARGETINFO : Gets or sets the restore target info
https://docs.microsoft.com/powershell/module/az.dataprotection/start-azdataprotectionbackupinstancerestore
#>
function Start-AzDataProtectionBackupInstanceRestore {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IOperationJobExtendedInfo])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IOperationJobExtendedInfo])]
[CmdletBinding(DefaultParameterSetName='Trigger', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -111,7 +112,7 @@ param(
[Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IAzureBackupRestoreRequest]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IAzureBackupRestoreRequest]
# Azure backup restore request
# To construct, see NOTES section for PARAMETER properties and create a hash table.
${Parameter},
@@ -124,7 +125,7 @@ param(
[Parameter(ParameterSetName='TriggerExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IRestoreTargetInfoBase]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IRestoreTargetInfoBase]
# Gets or sets the restore target information.
# To construct, see NOTES section for RESTORETARGETINFO properties and create a hash table.
${RestoreTargetInfo},
@@ -136,6 +137,12 @@ param(
# Gets or sets the type of the source data store.
${SourceDataStoreType},
+ [Parameter(ParameterSetName='TriggerExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Fully qualified Azure Resource Manager ID of the datasource which is being recovered.
+ ${SourceResourceId},
+
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
@@ -203,6 +210,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
Trigger = 'Az.DataProtection.private\Start-AzDataProtectionBackupInstanceRestore_Trigger';
TriggerExpanded = 'Az.DataProtection.private\Start-AzDataProtectionBackupInstanceRestore_TriggerExpanded';
@@ -217,6 +242,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -225,15 +251,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Stop-AzDataProtectionBackupInstanceProtection.ps1 b/src/DataProtection/exports/Stop-AzDataProtectionBackupInstanceProtection.ps1
new file mode 100644
index 000000000000..69ef13d8efd2
--- /dev/null
+++ b/src/DataProtection/exports/Stop-AzDataProtectionBackupInstanceProtection.ps1
@@ -0,0 +1,228 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+This operation will stop protection of a backup instance and data will be held forever
+.Description
+This operation will stop protection of a backup instance and data will be held forever
+.Example
+PS C:\> Stop-AzDataProtectionBackupInstanceProtection -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/stop-azdataprotectionbackupinstanceprotection
+#>
+function Stop-AzDataProtectionBackupInstanceProtection {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Stop', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Stop', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${BackupInstanceName},
+
+ [Parameter(ParameterSetName='Stop', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Stop')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Stop', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='StopViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Stop = 'Az.DataProtection.private\Stop-AzDataProtectionBackupInstanceProtection_Stop';
+ StopViaIdentity = 'Az.DataProtection.private\Stop-AzDataProtectionBackupInstanceProtection_StopViaIdentity';
+ }
+ if (('Stop') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/Suspend-AzDataProtectionBackupInstanceBackup.ps1 b/src/DataProtection/exports/Suspend-AzDataProtectionBackupInstanceBackup.ps1
new file mode 100644
index 000000000000..0c414eb14caa
--- /dev/null
+++ b/src/DataProtection/exports/Suspend-AzDataProtectionBackupInstanceBackup.ps1
@@ -0,0 +1,228 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+This operation will stop backups for backup instance
+.Description
+This operation will stop backups for backup instance
+.Example
+PS C:\> Suspend-AzDataProtectionBackupInstanceBackup -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [BackupInstanceName ]: The name of the backup instance
+ [BackupPolicyName ]:
+ [Id ]: Resource identity path
+ [JobId ]: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ [Location ]: The location in which uniqueness will be verified.
+ [OperationId ]:
+ [RecoveryPointId ]:
+ [RequestName ]:
+ [ResourceGroupName ]: The name of the resource group where the backup vault is present.
+ [ResourceGuardsName ]: The name of ResourceGuard
+ [SubscriptionId ]: The subscription Id.
+ [VaultName ]: The name of the backup vault.
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/suspend-azdataprotectionbackupinstancebackup
+#>
+function Suspend-AzDataProtectionBackupInstanceBackup {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Suspend', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Suspend', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${BackupInstanceName},
+
+ [Parameter(ParameterSetName='Suspend', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Suspend')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='Suspend', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter(ParameterSetName='SuspendViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Suspend = 'Az.DataProtection.private\Suspend-AzDataProtectionBackupInstanceBackup_Suspend';
+ SuspendViaIdentity = 'Az.DataProtection.private\Suspend-AzDataProtectionBackupInstanceBackup_SuspendViaIdentity';
+ }
+ if (('Suspend') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/Sync-AzDataProtectionBackupInstance.ps1 b/src/DataProtection/exports/Sync-AzDataProtectionBackupInstance.ps1
new file mode 100644
index 000000000000..ce002a099257
--- /dev/null
+++ b/src/DataProtection/exports/Sync-AzDataProtectionBackupInstance.ps1
@@ -0,0 +1,209 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state
+.Description
+Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state
+.Example
+PS C:\> Sync-AzDataProtectionBackupInstance -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
+
+.Outputs
+System.Boolean
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/sync-azdataprotectionbackupinstance
+#>
+function Sync-AzDataProtectionBackupInstance {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='SyncExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('BackupInstanceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # .
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the resource group where the backup vault is present.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [System.String]
+ # The name of the backup vault.
+ ${VaultName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The subscription Id.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SyncType])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.SyncType]
+ # Field indicating sync type e.g.
+ # to sync only in case of failure or in all cases
+ ${SyncType},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command asynchronously
+ ${NoWait},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ SyncExpanded = 'Az.DataProtection.private\Sync-AzDataProtectionBackupInstance_SyncExpanded';
+ }
+ if (('SyncExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/exports/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1 b/src/DataProtection/exports/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1
index 7951b34280db..17e1a083ec14 100644
--- a/src/DataProtection/exports/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1
+++ b/src/DataProtection/exports/Update-AzDataProtectionBackupInstanceAssociatedPolicy.ps1
@@ -20,22 +20,18 @@ Updates associated policy for a given backup instance
.Description
Updates associated policy for a given backup instance
.Example
-PS C:\> $sub = "xxxx-xxxx-xxxx"
-PS C:\> $instance = Get-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> $policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
-PS C:\> Update-AzDataProtectionBackupInstanceAssociatedPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[0].Name -PolicyId $policy[1].Id
-
-Name Type BackupInstanceName
----- ---- ------------------
-sarathdisk2-sarathdisk2-2ba3c708-3648-45e2-809d-9f75e66d404f Microsoft.DataProtection/backupVaults/backupInstances sarathdisk2-sarathdisk2-2ba3c708-3648-45e2-809d-9f75e66
+$sub = "xxxx-xxxx-xxxx"
+$instance = Get-AzDataProtectionBackupInstance -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
+$policy = Get-AzDataProtectionBackupPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault
+Update-AzDataProtectionBackupInstanceAssociatedPolicy -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName sarath-vault -BackupInstanceName $instance[0].Name -PolicyId $policy[1].Id
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource
.Link
https://docs.microsoft.com/powershell/module/az.dataprotection/update-azdataprotectionbackupinstanceassociatedpolicy
#>
function Update-AzDataProtectionBackupInstanceAssociatedPolicy {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource])]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
@@ -126,6 +122,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
__AllParameterSets = 'Az.DataProtection.custom\Update-AzDataProtectionBackupInstanceAssociatedPolicy';
}
@@ -136,6 +150,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -144,15 +159,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Update-AzDataProtectionBackupVault.ps1 b/src/DataProtection/exports/Update-AzDataProtectionBackupVault.ps1
index 8d16079ca9b2..5e1ef2cb329b 100644
--- a/src/DataProtection/exports/Update-AzDataProtectionBackupVault.ps1
+++ b/src/DataProtection/exports/Update-AzDataProtectionBackupVault.ps1
@@ -22,17 +22,19 @@ For example, updating tags for a resource.
Updates a BackupVault resource belonging to a resource group.
For example, updating tags for a resource.
.Example
-PS C:\> $tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
-PS C:\> Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
+$tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
+Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
+.Example
+PS C:\> Update-AzDataProtectionBackupVault -ResourceGroupName "rgName" -VaultName "vaultName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -AzureMonitorAlertsForAllJobFailure 'Disabled'
-ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
----- ------------------- ---------------- ------------ -------- ---- ----
- 2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
+Name Location Type IdentityType
+---- -------- ---- ------------
+vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource
.Notes
COMPLEX PARAMETER PROPERTIES
@@ -55,7 +57,7 @@ INPUTOBJECT : Identity Parameter
https://docs.microsoft.com/powershell/module/az.dataprotection/update-azdataprotectionbackupvault
#>
function Update-AzDataProtectionBackupVault {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupVaultResource])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupVaultResource])]
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
@@ -84,6 +86,14 @@ param(
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState])]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.AlertsState]
+ # Parameter to Enable or Disable built-in azure monitor alerts for job failures.
+ # Security alerts cannot be disabled.
+ ${AzureMonitorAlertsForAllJobFailure},
+
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
[System.String]
@@ -92,7 +102,7 @@ param(
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IPatchResourceRequestInputTags]))]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IPatchResourceRequestInputTags]))]
[System.Collections.Hashtable]
# Resource tags.
${Tag},
@@ -164,6 +174,24 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
$mapping = @{
UpdateExpanded = 'Az.DataProtection.private\Update-AzDataProtectionBackupVault_UpdateExpanded';
UpdateViaIdentityExpanded = 'Az.DataProtection.private\Update-AzDataProtectionBackupVault_UpdateViaIdentityExpanded';
@@ -178,6 +206,7 @@ begin {
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
}
@@ -186,15 +215,32 @@ process {
try {
$steppablePipeline.Process($_)
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
end {
try {
$steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
} catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
throw
}
-}
+}
}
diff --git a/src/DataProtection/exports/Update-AzDataProtectionResourceGuard.ps1 b/src/DataProtection/exports/Update-AzDataProtectionResourceGuard.ps1
new file mode 100644
index 000000000000..8fb6c3ee9603
--- /dev/null
+++ b/src/DataProtection/exports/Update-AzDataProtectionResourceGuard.ps1
@@ -0,0 +1,193 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Updates a resource guard belonging to a resource group
+.Description
+Updates a resource guard belonging to a resource group
+.Example
+PS C:\> $resourceGuard = Get-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "rgName" -Name "resGuardName"
+PS C:\> $criticalOperations = $resourceGuard.ResourceGuardOperation.VaultCriticalOperation
+PS C:\> $operationsToBeExcluded = $criticalOperations | where { $_ -match "backupSecurityPIN/action" -or $_ -match "backupInstances/delete" }
+PS C:\> Update-AzDataProtectionResourceGuard -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "rgName" -Name $resourceGuard.Name -CriticalOperationExclusionList $operationsToBeExcluded
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource
+.Link
+https://docs.microsoft.com/powershell/module/az.dataprotection/update-azdataprotectionresourceguard
+#>
+function Update-AzDataProtectionResourceGuard {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IResourceGuardResource])]
+[CmdletBinding(DefaultParameterSetName='UpdateResourceGuardOperations', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Resource Group name of the resource guard
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Name of the resource guard
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Subscription Id of the resource guard
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # Optional ETag
+ ${ETag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String]
+ # The identityType to be updated in resource guard, example: SystemAssigned, None
+ ${IdentityType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Collections.Hashtable]
+ # Resource tags
+ ${Tag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.String[]]
+ # List of critical operations which are not protected by this resourceGuard.
+ # Supported values are DeleteProtection, UpdateProtection, UpdatePolicy, GetSecurityPin
+ ${CriticalOperationExclusionList},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSObject]
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]]
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Uri]
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.PSCredential]
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ UpdateResourceGuardOperations = 'Az.DataProtection.custom\Update-AzDataProtectionResourceGuard';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/DataProtection/generate-info.json b/src/DataProtection/generate-info.json
index d4858e25ce45..fad830ea437f 100644
--- a/src/DataProtection/generate-info.json
+++ b/src/DataProtection/generate-info.json
@@ -1,8 +1,8 @@
{
- "swagger_commit": "14b3b50008f77d12b7b2e238753c52b8f857cb63",
- "autorest_modelerfour": "4.15.414",
- "autorest_core": "3.7.3",
+ "swagger_commit": "9a6b5748f6ba9eeb2684497551226036c9d1da6b",
"autorest": "`-- (empty)",
- "node": "v14.15.5",
- "autorest_powershell": "3.0.469"
+ "autorest_core": "3.8.4",
+ "autorest_modelerfour": "4.15.414",
+ "autorest_powershell": "3.0.490",
+ "node": "v14.15.5"
}
diff --git a/src/DataProtection/generated/Module.cs b/src/DataProtection/generated/Module.cs
index 7d6bad60e220..76aac8e1b6e3 100644
--- a/src/DataProtection/generated/Module.cs
+++ b/src/DataProtection/generated/Module.cs
@@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DataProtection
using GetParameterDelegate = global::System.Func;
using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
using ArgumentCompleterDelegate = global::System.Func;
+ using GetTelemetryIdDelegate = global::System.Func;
+ using TelemetryDelegate = global::System.Action;
using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
@@ -30,6 +32,8 @@ public partial class Module
/// the ISendAsync pipeline instance (when proxy is enabled)
private Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.HttpPipeline _pipelineWithProxy;
+ public bool _useProxy = false;
+
public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
/// Gets completion data for azure specific fields
@@ -44,6 +48,9 @@ public partial class Module
/// The delegate to call to get parameter data from a common module.
public GetParameterDelegate GetParameterValue { get; set; }
+ /// The delegate to get the telemetry Id.
+ public GetTelemetryIdDelegate GetTelemetryId { get; set; }
+
/// Backing field for property.
private static Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Module _instance;
@@ -65,6 +72,9 @@ public partial class Module
/// The ResourceID for this module (azure arm).
public string ResourceId => @"Az.DataProtection";
+ /// The delegate for creating a telemetry.
+ public TelemetryDelegate Telemetry { get; set; }
+
/// The from the cmdlet
/// The HttpPipeline for the request
@@ -88,7 +98,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.HttpPipeline Cr
{
Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.HttpPipeline pipeline = null;
BeforeCreatePipeline(invocationInfo, ref pipeline);
- pipeline = (pipeline ?? (_handler.UseProxy ? _pipelineWithProxy : _pipeline)).Clone();
+ pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone();
AfterCreatePipeline(invocationInfo, ref pipeline);
pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync);
OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } );
@@ -115,7 +125,7 @@ public void Init()
/// Creates the module instance.
private Module()
{
- /// constructor
+ // constructor
ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.DataProtection.DataProtection();
_handler.Proxy = _webProxy;
_pipeline = new Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient()));
@@ -127,12 +137,24 @@ private Module()
/// True if the proxy should use default credentials
public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials)
{
+ _useProxy = proxy != null;
+ if (proxy == null)
+ {
+ return;
+ }
// set the proxy configuration
_webProxy.Address = proxy;
_webProxy.BypassProxyOnLocal = false;
- _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
- _webProxy.UseDefaultCredentials = proxyUseDefaultCredentials;
- _handler.UseProxy = proxy != null;
+ if (proxyUseDefaultCredentials)
+ {
+ _webProxy.Credentials = null;
+ _webProxy.UseDefaultCredentials = true;
+ }
+ else
+ {
+ _webProxy.UseDefaultCredentials = false;
+ _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
+ }
}
/// Called to dispatch events to the common module listener
diff --git a/src/DataProtection/generated/api/DataProtection.cs b/src/DataProtection/generated/api/DataProtection.cs
index d580d8775b64..91ee589bff73 100644
--- a/src/DataProtection/generated/api/DataProtection.cs
+++ b/src/DataProtection/generated/api/DataProtection.cs
@@ -14,9 +14,9 @@ public partial class DataProtection
{
/// Trigger adhoc backup
- /// The name of the backup vault.
- /// The name of the resource group where the backup vault is present.
/// The subscription Id.
+ /// The name of the resource group where the backup vault is present.
+ /// The name of the backup vault.
/// The name of the backup instance
/// Request body for operation
/// a delegate that is called when the remote service returns 200 (OK).
@@ -27,9 +27,9 @@ public partial class DataProtection
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task BackupInstancesAdhocBackup(string vaultName, string resourceGroupName, string subscriptionId, string backupInstanceName, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ITriggerBackupRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task BackupInstancesAdhocBackup(string subscriptionId, string resourceGroupName, string vaultName, string backupInstanceName, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ITriggerBackupRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
{
- var apiVersion = @"2021-07-01";
+ var apiVersion = @"2022-04-01";
// Constant Parameters
using( NoSynchronizationContext )
{
@@ -76,9 +76,9 @@ public partial class DataProtection
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task BackupInstancesAdhocBackupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ITriggerBackupRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task BackupInstancesAdhocBackupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ITriggerBackupRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
{
- var apiVersion = @"2021-07-01";
+ var apiVersion = @"2022-04-01";
// Constant Parameters
using( NoSynchronizationContext )
{
@@ -91,9 +91,9 @@ public partial class DataProtection
}
// replace URI parameters with values from identity
- var vaultName = _match.Groups["vaultName"].Value;
- var resourceGroupName = _match.Groups["resourceGroupName"].Value;
var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var vaultName = _match.Groups["vaultName"].Value;
var backupInstanceName = _match.Groups["backupInstanceName"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
@@ -137,7 +137,7 @@ public partial class DataProtection
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task BackupInstancesAdhocBackup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task BackupInstancesAdhocBackup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -244,6 +244,7 @@ public partial class DataProtection
// make the final call
_response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
break;
}
}
@@ -254,13 +255,13 @@ public partial class DataProtection
case global::System.Net.HttpStatusCode.OK:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.OperationJobExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.OperationJobExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -279,22 +280,22 @@ public partial class DataProtection
/// Validation method for method. Call this like the actual call, but you will get
/// validation events back.
///
- /// The name of the backup vault.
- /// The name of the resource group where the backup vault is present.
/// The subscription Id.
+ /// The name of the resource group where the backup vault is present.
+ /// The name of the backup vault.
/// The name of the backup instance
/// Request body for operation
/// an instance that will receive events.
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task BackupInstancesAdhocBackup_Validate(string vaultName, string resourceGroupName, string subscriptionId, string backupInstanceName, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.ITriggerBackupRequest body, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener)
+ internal async global::System.Threading.Tasks.Task BackupInstancesAdhocBackup_Validate(string subscriptionId, string resourceGroupName, string vaultName, string backupInstanceName, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.ITriggerBackupRequest body, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener)
{
using( NoSynchronizationContext )
{
- await eventListener.AssertNotNull(nameof(vaultName),vaultName);
- await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertNotNull(nameof(vaultName),vaultName);
await eventListener.AssertNotNull(nameof(backupInstanceName),backupInstanceName);
await eventListener.AssertNotNull(nameof(body), body);
await eventListener.AssertObjectIsValid(nameof(body), body);
@@ -302,9 +303,9 @@ public partial class DataProtection
}
/// Create or update a backup instance in a backup vault
- /// The name of the backup vault.
- /// The name of the resource group where the backup vault is present.
/// The subscription Id.
+ /// The name of the resource group where the backup vault is present.
+ /// The name of the backup vault.
/// The name of the backup instance
/// Request body for operation
/// a delegate that is called when the remote service returns 200 (OK).
@@ -315,9 +316,9 @@ public partial class DataProtection
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task BackupInstancesCreateOrUpdate(string vaultName, string resourceGroupName, string subscriptionId, string backupInstanceName, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task BackupInstancesCreateOrUpdate(string subscriptionId, string resourceGroupName, string vaultName, string backupInstanceName, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
{
- var apiVersion = @"2021-07-01";
+ var apiVersion = @"2022-04-01";
// Constant Parameters
using( NoSynchronizationContext )
{
@@ -363,9 +364,9 @@ public partial class DataProtection
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task BackupInstancesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.IBackupInstanceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task BackupInstancesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.IBackupInstanceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
{
- var apiVersion = @"2021-07-01";
+ var apiVersion = @"2022-04-01";
// Constant Parameters
using( NoSynchronizationContext )
{
@@ -378,9 +379,9 @@ public partial class DataProtection
}
// replace URI parameters with values from identity
- var vaultName = _match.Groups["vaultName"].Value;
- var resourceGroupName = _match.Groups["resourceGroupName"].Value;
var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var vaultName = _match.Groups["vaultName"].Value;
var backupInstanceName = _match.Groups["backupInstanceName"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
@@ -423,7 +424,7 @@ public partial class DataProtection
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task BackupInstancesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task BackupInstancesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -529,6 +530,7 @@ public partial class DataProtection
// make the final call
_response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
break;
}
}
@@ -539,13 +541,13 @@ public partial class DataProtection
case global::System.Net.HttpStatusCode.OK:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.BackupInstanceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.BackupInstanceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20210701.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220401.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -564,22 +566,22 @@ public partial class DataProtection
/// Validation method for