{"record":{"id":"2b7ec267f8fc209e","repo":"peass-ng/PEASS-ng","slug":"a-maximum-of-32-values-is-allowed","errorCode":null,"errorMessage":"A maximum of 32 values is allowed.","messagePattern":"A maximum of 32 values is allowed\\.","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs","lineNumber":1402,"sourceCode":"        /// <a href=\"https://docs.microsoft.com/en-us/windows/desktop/taskschd/task-actions#using-variables-in-action-properties\">Task Actions</a>.\n        /// </para>\n        /// </param>\n        /// <returns>A <see cref=\"RunningTask\"/> instance that defines the new instance of the task.</returns>\n        /// <example>\n        /// <code lang=\"cs\">\n        ///<![CDATA[\n        /// // Run the current task with a parameter\n        /// var runningTask = myTaskInstance.Run(\"info\");\n        /// Console.Write(string.Format(\"Running task's current action is {0}.\", runningTask.CurrentAction));\n        ///]]>\n        /// </code>\n        /// </example>\n        public RunningTask Run(params string[] parameters)\n        {\n            if (v2Task != null)\n            {\n                if (parameters.Length > 32)\n                    throw new ArgumentOutOfRangeException(nameof(parameters), \"A maximum of 32 values is allowed.\");\n                if (TaskService.HighestSupportedVersion < TaskServiceVersion.V1_5 && parameters.Any(p => (p?.Length ?? 0) >= 260))\n                    throw new ArgumentOutOfRangeException(nameof(parameters), \"On systems prior to Windows 10, all individual parameters must be less than 260 characters.\");\n                var irt = v2Task.Run(parameters.Length == 0 ? null : parameters);\n                return irt != null ? new RunningTask(TaskService, v2Task, irt) : null;\n            }\n\n            v1Task.Run();\n            return new RunningTask(TaskService, v1Task);\n        }\n\n        /// <summary>Runs the registered task immediately using specified flags and a session identifier.</summary>\n        /// <param name=\"flags\">Defines how the task is run.</param>\n        /// <param name=\"sessionID\">\n        /// <para>The terminal server session in which you want to start the task.</para>\n        /// <para>\n        /// If the <see cref=\"TaskRunFlags.UseSessionId\"/> value is not passed into the <paramref name=\"flags\"/> parameter, then the value\n        /// specified in this parameter is ignored.If the <see cref=\"TaskRunFlags.UseSessionId\"/> value is passed into the flags parameter\n        /// and the sessionID value is less than or equal to 0, then an invalid argument error will be returned.","sourceCodeStart":1384,"sourceCodeEnd":1420,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs#L1384-L1420","documentation":"Task.Run enforces the Task Scheduler's limit that at most 32 command-line parameters can be passed to a launched task instance. Passing more than 32 values triggers this error; the count of the parameters array is the invalid input.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs:1402 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the parameters to 32 or fewer, combining values (e.g. quoted or delimited strings).","Pass bulk data via a file path or environment/config file rather than as parameters.","Split the workload across multiple task runs if more than 32 values are truly needed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}