Thanks, here's what I did:
$advert = $smscli.softwareDistribution.lgetAdverts($tsPackageID,$tsProgramID)
$xNode = $xDoc.SelectSingleNode("SWDReserved/OverrideServiceWindows")
$xNode.InnerText = "TRUE";
And it finally executed the Task Sequence. Sadly, there's no time to rejoice since it failed almost immediately after kick-off.
Failed to reboot the machine because the service window is not available
Failed to initialize a system reboot.
Unspecified error (Error: 80004005; Source: Windows)
BTW, the TS starts with a System Reboot. So now the service window is not available huh....
I went back to the XMLDocument object to see if I can tweak other nodes and found this: SWDReserved/RebootOutsideOfServiceWindows. I tried setting it to TRUE but unfortunately I had the same result.
I tried manually running the same TS from RAP and it worked as expected.