// show warning only for Geo selected, not for none specified protected new void ShowBackupStorageRedundancyWarningIfNeeded(string backupStorageRedundancy, string location) { if (ListOfRegionsToShowWarningMessageForGeoBackupStorage.Contains(location.ToLower())) { if (backupStorageRedundancy != null) { if (string.Equals(backupStorageRedundancy, "Geo", System.StringComparison.OrdinalIgnoreCase)) { WriteWarning(string.Format(CultureInfo.InvariantCulture, Properties.Resources.BackupRedundancyChosenIsGeoWarning)); } } } }
/// <summary> /// Overriding to add warning message /// </summary> public override void ExecuteCmdlet() { ModelAdapter = InitModelAdapter(); string location = ModelAdapter.GetServerLocation(ResourceGroupName, ServerName); if (ListOfRegionsToShowWarningMessageForGeoBackupStorage.Contains(location.ToLower())) { if (string.Equals(this.BackupStorageRedundancy, "Geo", System.StringComparison.OrdinalIgnoreCase)) { WriteWarning(string.Format(CultureInfo.InvariantCulture, Properties.Resources.GeoBackupRedundancyChosenWarning)); } } base.ExecuteCmdlet(); }
/// <summary> /// Overriding to add warning message /// </summary> public override void ExecuteCmdlet() { ModelAdapter = InitModelAdapter(); string location = ModelAdapter.GetServerLocation(ResourceGroupName, ServerName); if (ListOfRegionsToShowWarningMessageForGeoBackupStorage.Contains(location.ToLower())) { if (this.BackupStorageRedundancy == null) { if (!Force.IsPresent && !ShouldContinue( string.Format(CultureInfo.InvariantCulture, Properties.Resources.DoYouWantToProceed, this.DatabaseName), string.Format(CultureInfo.InvariantCulture, Properties.Resources.BackupRedundancyNotChosenTakeGeoWarning))) { return; } } else if (string.Equals(this.BackupStorageRedundancy, "Geo", System.StringComparison.OrdinalIgnoreCase)) { WriteWarning(string.Format(CultureInfo.InvariantCulture, Properties.Resources.GeoBackupRedundancyChosenWarning)); } } base.ExecuteCmdlet(); }