public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); Dictionary <Enum, object> providerParameters = new Dictionary <Enum, object>(); providerParameters.Add(PolicyParams.ScheduleRunFrequency, ScheduleRunFrequency); providerParameters.Add(PolicyParams.PolicySubType, PolicySubType); 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); } if (PolicySubType == PSPolicyType.Enhanced && WorkloadType != WorkloadType.AzureVM) { throw new ArgumentException(Resources.EnhancedPolicyNotSupported); } PsBackupProviderManager providerManager = new PsBackupProviderManager( providerParameters, ServiceClientAdapter); IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance( WorkloadType, BackupManagementType); WriteObject(psBackupProvider.GetDefaultSchedulePolicyObject()); }); }
public override void ExecuteCmdlet() { ExecutionBlock(() => { base.ExecuteCmdlet(); PsBackupProviderManager providerManager = new PsBackupProviderManager( new Dictionary <Enum, object>(), ServiceClientAdapter); IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance( WorkloadType, BackupManagementType); WriteObject(psBackupProvider.GetDefaultSchedulePolicyObject()); }); }
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.GetDefaultSchedulePolicyObject()); }); }