public override void ExecuteCmdlet() { string status = string.Empty; if (PassThru.IsPresent) { WriteObject(SMClient.PatchStorageJob(new PSCreateJobParams { Region = Location, JobCollectionName = JobCollectionName, JobName = JobName, StorageAccount = StorageQueueAccount, QueueName = StorageQueueName, SasToken = SASToken, StorageQueueMessage = StorageQueueMessage, StartTime = StartTime, Interval = Interval, Frequency = Frequency, EndTime = EndTime, ExecutionCount = ExecutionCount, JobState = JobState, ErrorActionMethod = ErrorActionMethod, ErrorActionBody = ErrorActionRequestBody, ErrorActionHeaders = ErrorActionHeaders, ErrorActionUri = ErrorActionURI, ErrorActionStorageAccount = ErrorActionStorageAccount, ErrorActionQueueName = ErrorActionStorageQueue, ErrorActionQueueBody = ErrorActionQueueMessageBody, ErrorActionSasToken = ErrorActionSASToken }, out status), true); WriteObject(status); } else { SMClient.PatchStorageJob(new PSCreateJobParams { Region = Location, JobCollectionName = JobCollectionName, JobName = JobName, StorageAccount = StorageQueueAccount, QueueName = StorageQueueName, SasToken = SASToken, StorageQueueMessage = StorageQueueMessage, StartTime = StartTime, Interval = Interval, Frequency = Frequency, EndTime = EndTime, ExecutionCount = ExecutionCount, JobState = JobState, ErrorActionMethod = ErrorActionMethod, ErrorActionBody = ErrorActionRequestBody, ErrorActionHeaders = ErrorActionHeaders, ErrorActionUri = ErrorActionURI, ErrorActionStorageAccount = ErrorActionStorageAccount, ErrorActionQueueName = ErrorActionStorageQueue, ErrorActionQueueBody = ErrorActionQueueMessageBody, ErrorActionSasToken = ErrorActionSASToken }, out status); WriteDebug(status); } }
public override void ExecuteCmdlet() { string status = string.Empty; if (!SMClient.GetAvailableRegions().Contains(Location, StringComparer.OrdinalIgnoreCase)) { WriteWarning(Resources.SchedulerInvalidLocation); } else { if (PassThru.IsPresent) { WriteObject(SMClient.PatchStorageJob(new PSCreateJobParams { Region = Location, JobCollectionName = JobCollectionName, JobName = JobName, StorageAccount = StorageQueueAccount, QueueName = StorageQueueName, SasToken = SASToken, StorageQueueMessage = StorageQueueMessage, StartTime = StartTime, Interval = Interval, Frequency = Frequency, EndTime = EndTime, ExecutionCount = ExecutionCount, JobState = JobState, ErrorActionMethod = ErrorActionMethod, ErrorActionBody = ErrorActionRequestBody, ErrorActionHeaders = ErrorActionHeaders, ErrorActionUri = ErrorActionURI, ErrorActionStorageAccount = ErrorActionStorageAccount, ErrorActionQueueName = ErrorActionStorageQueue, ErrorActionQueueBody = ErrorActionQueueMessageBody, ErrorActionSasToken = ErrorActionSASToken }, out status), true); } else { SMClient.PatchStorageJob(new PSCreateJobParams { Region = Location, JobCollectionName = JobCollectionName, JobName = JobName, StorageAccount = StorageQueueAccount, QueueName = StorageQueueName, SasToken = SASToken, StorageQueueMessage = StorageQueueMessage, StartTime = StartTime, Interval = Interval, Frequency = Frequency, EndTime = EndTime, ExecutionCount = ExecutionCount, JobState = JobState, ErrorActionMethod = ErrorActionMethod, ErrorActionBody = ErrorActionRequestBody, ErrorActionHeaders = ErrorActionHeaders, ErrorActionUri = ErrorActionURI, ErrorActionStorageAccount = ErrorActionStorageAccount, ErrorActionQueueName = ErrorActionStorageQueue, ErrorActionQueueBody = ErrorActionQueueMessageBody, ErrorActionSasToken = ErrorActionSASToken }, out status); WriteDebug(status); } } }