/// <summary> /// Write Recovery Plans. /// </summary> /// <param name="recoveryPlanList">List of Recovery Plans</param> private void WriteRecoveryPlans(IList <RecoveryPlan> recoveryPlanList) { IList <ASRRecoveryPlan> asrRecoveryPlans = new List <ASRRecoveryPlan>(); foreach (RecoveryPlan recoveryPlan in recoveryPlanList) { var replicationProtectedItemListResponse = RecoveryServicesClient.GetAzureSiteRecoveryReplicationProtectedItemInRP(recoveryPlan.Name); asrRecoveryPlans.Add(new ASRRecoveryPlan(recoveryPlan, replicationProtectedItemListResponse.ReplicationProtectedItems)); } this.WriteObject(asrRecoveryPlans, true); }
/// <summary> /// Write Recovery Plan. /// </summary> /// <param name="recoveryPlan">Recovery Plan object</param> private void WriteRecoveryPlan(RecoveryPlan recoveryPlan) { var replicationProtectedItemListResponse = RecoveryServicesClient.GetAzureSiteRecoveryReplicationProtectedItemInRP(recoveryPlan.Name); this.WriteObject(new ASRRecoveryPlan(recoveryPlan, replicationProtectedItemListResponse.ReplicationProtectedItems)); }