peass-ng/PEASS-ng · error · NotV1SupportedException

Only a single week can be set with Task Scheduler 1.0.

Error message

Only a single week can be set with Task Scheduler 1.0.

What it means

Interop guard in the V1 MONTHLYDOW struct's V2WhichWeek setter: Task Scheduler 1.0 can store only a single week selector, so the incoming WhichWeek flags mask is matched against the single-bit values {0x1,0x2,0x4,0x8,0x10}; any combined mask (multiple bits) or out-of-range value finds no match (Array.IndexOf returns -1) and NotV1SupportedException is thrown. The faulting input is the value being assigned.

Source

Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/V1/TaskSchedulerV1Interop.cs:233

    internal struct MonthlyDOW
    {
        public ushort WhichWeek;
        public DaysOfTheWeek DaysOfTheWeek;
        public MonthsOfTheYear Months;

        public WhichWeek V2WhichWeek
        {
            get
            {
                return (WhichWeek)(1 << ((short)WhichWeek - 1));
            }
            set
            {
                int idx = Array.IndexOf(new short[] { 0x1, 0x2, 0x4, 0x8, 0x10 }, (short)value);
                if (idx >= 0)
                    WhichWeek = (ushort)(idx + 1);
                else
                    throw new NotV1SupportedException("Only a single week can be set with Task Scheduler 1.0.");
            }
        }
    }

    [StructLayout(LayoutKind.Explicit)]
    internal struct TriggerTypeData
    {
        [FieldOffset(0)]
        public Daily daily;
        [FieldOffset(0)]
        public Weekly weekly;
        [FieldOffset(0)]
        public MonthlyDate monthlyDate;
        [FieldOffset(0)]
        public MonthlyDOW monthlyDOW;
    }

    [StructLayout(LayoutKind.Sequential)]

View on GitHub (pinned to 53fb989abc)

Solutions

  1. Assign only one of the single week flags (First..FourthWeek or LastWeek equivalents 0x1-0x10) when running against Task Scheduler 1.0
  2. Split tasks into separate registrations, one per selected week, if multiple weeks are needed on V1
  3. Use Task Scheduler 2.0+, whose monthly-DOW trigger supports combined week masks
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/V1/TaskSchedulerV1Interop.cs:233 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02). Data as JSON: /api/errors/cd4740993fb16c16. Report an issue: GitHub.