public override void ExecuteCmdlet() { base.ExecuteCmdlet(); ExecutionBlock(() => { WriteDebug(Resources.MakingClientCall); if (RecoveryPointId != null) { CSMRecoveryPointResponse recoveryPointObject = AzureBackupClient.GetRecoveryPoint(Item.ResourceGroupName, Item.ResourceName, Item.ContainerUniqueName, Item.ItemName, RecoveryPointId); if (recoveryPointObject != null) { WriteAzureBackupRecoveryPoint(recoveryPointObject, Item); } else { WriteDebug(string.Format(Resources.NoRpExist, RecoveryPointId)); } } else { IEnumerable <CSMRecoveryPointResponse> recoveryPointListResponse = AzureBackupClient.ListRecoveryPoints(Item.ResourceGroupName, Item.ResourceName, Item.ContainerUniqueName, Item.ItemName); if (recoveryPointListResponse != null && recoveryPointListResponse.Count <CSMRecoveryPointResponse>() > 0) { IEnumerable <CSMRecoveryPointResponse> recoveryPointObjects = recoveryPointListResponse.OrderByDescending(x => x.Properties.RecoveryPointTime); if (recoveryPointObjects.Count <CSMRecoveryPointResponse>() > 1) { WriteAzureBackupRecoveryPoint(recoveryPointObjects, Item); } else { WriteAzureBackupRecoveryPoint(recoveryPointObjects.FirstOrDefault <CSMRecoveryPointResponse>(), Item); } } else { WriteDebug(Resources.NoRpFound); } } }); }