public override void ExecuteCmdlet() { try { // Make sure params were supplied appropriately. ProcessParameters(); // Make call to get device jobs. var response = StorSimpleClient.GetDeviceJobs(deviceId, Type, Status, InstanceId, fromDateTimeIsoString, toDateTimeIsoString, (int)Skip, (int)First); WriteObject(response.DeviceJobList, true); WriteVerbose(string.Format(Resources.DeviceJobsReturnedCount, response.DeviceJobList.Count, response.DeviceJobList.Count > 1 ? "s" : string.Empty)); if (response.NextPageUri != null && response.NextPageStartIdentifier != "-1") { if (First != null) { //user has provided First(Top) parameter while calling the commandlet //so we need to provide it to him for calling the next page WriteVerbose(string.Format(Resources.DeviceJobsNextPageFormatMessage, First, response.NextPageStartIdentifier)); } else { //user has NOT provided First(Top) parameter while calling the commandlet //so we DONT need to provide it to him for calling the next page WriteVerbose(string.Format(Resources.DeviceJobsNextPagewithNoFirstMessage, response.NextPageStartIdentifier)); } } else { WriteVerbose(Resources.DeviceJobsNoMorePagesMessage); } } catch (Exception exception) { HandleException(exception); } }