public override void ExecuteCmdlet()
        {
            if (Tasks != null)
            {
                NewBulkTaskParameters parameters = new NewBulkTaskParameters(this.BatchContext, this.JobId, this.Job, this.Tasks, this.AdditionalBehaviors);
                BatchClient.AddTaskCollection(parameters);
            }
            else
            {
                NewTaskParameters parameters = new NewTaskParameters(this.BatchContext, this.JobId, this.Job,
                                                                     this.Id, this.AdditionalBehaviors)
                {
                    DisplayName                  = this.DisplayName,
                    CommandLine                  = this.CommandLine,
                    ResourceFiles                = this.ResourceFiles,
                    EnvironmentSettings          = this.EnvironmentSettings,
                    RunElevated                  = this.RunElevated.IsPresent,
                    AffinityInformation          = this.AffinityInformation,
                    Constraints                  = this.Constraints,
                    MultiInstanceSettings        = this.MultiInstanceSettings,
                    DependsOn                    = this.DependsOn,
                    ApplicationPackageReferences = this.ApplicationPackageReferences,
                    ExitConditions               = this.ExitConditions,
                };

                BatchClient.CreateTask(parameters);
            }
        }
Ejemplo n.º 2
0
        protected override void ExecuteCmdletImpl()
        {
            if (Tasks != null)
            {
                NewBulkTaskParameters parameters = new NewBulkTaskParameters(this.BatchContext, this.JobId, this.Job, this.Tasks, this.AdditionalBehaviors);
                BatchClient.AddTaskCollection(parameters);
            }
            else
            {
                NewTaskParameters parameters = new NewTaskParameters(this.BatchContext, this.JobId, this.Job,
                                                                     this.Id, this.AdditionalBehaviors)
                {
                    DisplayName                 = this.DisplayName,
                    CommandLine                 = this.CommandLine,
                    ResourceFiles               = this.ResourceFiles,
                    EnvironmentSettings         = this.EnvironmentSettings,
                    AuthenticationTokenSettings = this.AuthenticationTokenSettings,
                    UserIdentity                = this.UserIdentity,
                    AffinityInformation         = this.AffinityInformation,
                    Constraints                 = this.Constraints,
                    MultiInstanceSettings       = this.MultiInstanceSettings,
                    DependsOn = this.DependsOn,
                    ApplicationPackageReferences = this.ApplicationPackageReferences,
                    ExitConditions    = this.ExitConditions,
                    OutputFiles       = this.OutputFile,
                    ContainerSettings = this.ContainerSettings
                };

                BatchClient.CreateTask(parameters);
            }
        }