public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); Dictionary <Enum, object> providerParameters = new Dictionary <Enum, object>(); providerParameters.Add(PolicyParams.ScheduleRunFrequency, ScheduleRunFrequency); if (ScheduleRunFrequency != ScheduleRunType.Daily && WorkloadType != WorkloadType.AzureVM && WorkloadType != WorkloadType.AzureFiles) { throw new ArgumentException(Resources.UnexpectedParamScheduleRunFrequency); } if (ScheduleRunFrequency == ScheduleRunType.Weekly && WorkloadType == WorkloadType.AzureFiles) { throw new ArgumentException(Resources.WeeklyScheduleNotSupported); } PsBackupProviderManager providerManager = new PsBackupProviderManager(providerParameters, ServiceClientAdapter); IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance(WorkloadType, BackupManagementType); WriteObject(psBackupProvider.GetDefaultRetentionPolicyObject()); }); }
public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); PsBackupProviderManager providerManager = new PsBackupProviderManager(new Dictionary <Enum, object>(), ServiceClientAdapter); IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance(WorkloadType, BackupManagementType); WriteObject(psBackupProvider.GetDefaultRetentionPolicyObject()); }); }
public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); Dictionary <Enum, object> providerParameters = new Dictionary <Enum, object>(); providerParameters.Add(PolicyParams.ScheduleRunFrequency, ScheduleRunFrequency); PsBackupProviderManager providerManager = new PsBackupProviderManager(providerParameters, ServiceClientAdapter); IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance(WorkloadType, BackupManagementType); WriteObject(psBackupProvider.GetDefaultRetentionPolicyObject()); }); }