Exemplo n.º 1
0
        public override void ExecuteCmdlet()
        {
            string status = string.Empty;

            WriteObject(SMClient.CreateHttpJob(new PSCreateJobParams
            {
                Region            = Location,
                JobCollectionName = JobCollectionName,
                JobName           = JobName,
                Method            = Method,
                Headers           = Headers,
                Uri                       = URI,
                Body                      = RequestBody,
                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,
                HttpAuthType              = HttpAuthenticationType ?? string.Empty,
                ClientCertPfx             = ClientCertificatePfx == null ? null : SchedulerUtils.GetCertData(this.ResolvePath(ClientCertificatePfx.ToString()), ClientCertificatePassword),
                ClientCertPassword        = ClientCertificatePassword
            }, out status), true);
            WriteObject(status);
        }
        public override void ExecuteCmdlet()
        {
            string status = string.Empty;

            WriteObject(SMClient.CreateHttpJob(new PSCreateJobParams
            {
                Region            = Location,
                JobCollectionName = JobCollectionName,
                JobName           = JobName,
                Method            = Method,
                Headers           = Headers,
                Uri                       = URI,
                Body                      = RequestBody,
                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);
        }
        public override void ExecuteCmdlet()
        {
            string status = string.Empty;

            if (!SMClient.GetAvailableRegions().Contains(Location, StringComparer.OrdinalIgnoreCase))
            {
                throw new Exception(Resources.SchedulerInvalidLocation);
            }
            else
            {
                WriteObject(SMClient.CreateHttpJob(new PSCreateJobParams
                {
                    Region            = Location,
                    JobCollectionName = JobCollectionName,
                    JobName           = JobName,
                    Method            = Method,
                    Headers           = Headers,
                    Uri                       = URI,
                    Body                      = RequestBody,
                    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);
            }
        }