{"record":{"id":"15edf5650cd08123","repo":"peass-ng/PEASS-ng","slug":"multi-dimensional-arrays-are-not-supported","errorCode":null,"errorMessage":"Multi-dimensional arrays are not supported.","messagePattern":"Multi-dimensional arrays are not supported\\.","errorType":"exception","errorClass":"RankException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/ActionCollection.cs","lineNumber":631,"sourceCode":"            if (Count > 1)\n                return Properties.Resources.MultipleActions;\n            return string.Empty;\n        }\n\n        void ICollection<Action>.Add(Action item) => Add(item);\n\n        int IList.Add(object value)\n        {\n            Add((Action)value);\n            return Count - 1;\n        }\n\n        bool IList.Contains(object value) => Contains((Action)value);\n\n        void ICollection.CopyTo(Array array, int index)\n        {\n            if (array != null && array.Rank != 1)\n                throw new RankException(\"Multi-dimensional arrays are not supported.\");\n            var src = new Action[Count];\n            CopyTo(src, 0);\n            Array.Copy(src, 0, array, index, Count);\n        }\n\n        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n\n        System.Xml.Schema.XmlSchema IXmlSerializable.GetSchema() => null;\n\n        int IList.IndexOf(object value) => IndexOf((Action)value);\n\n        void IList.Insert(int index, object value) => Insert(index, (Action)value);\n\n        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)\n        {\n            reader.ReadStartElement(XmlSerializationHelper.GetElementName(this), TaskDefinition.tns);\n            Context = reader.GetAttribute(\"Context\");\n            while (reader.MoveToContent() == System.Xml.XmlNodeType.Element)","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/ActionCollection.cs#L613-L649","documentation":"ICollection.CopyTo(Array, int) explicitly rejects multi-dimensional target arrays by throwing RankException when array.Rank != 1. The guard exists because the Win32 Task Scheduler named-value storage is flat; copying into a 2D array has no meaningful mapping.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/ActionCollection.cs:631 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a one-dimensional Action[] (or Array) as the destination.","Flatten any multi-dimensional array into a 1D array before calling CopyTo.","Copy element-by-element with a foreach over the collection instead of using CopyTo."],"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"}