I was attempting to use PAM for rotating passwords in a Windows Scheduled Task, and I was running into an error with the path to the scheduled task:
Propagation: Error
Error while executing the script Scheduled Task with the configuration Test Schedule: Cannot validate argument on parameter 'ScheduledTaskPath'. The argument "\" does not match the "^\\(?:[^\\]+\\)+\s*(?:,\s*\\(?:[^\\]+\\)+)*$" pattern. Supply an argument that matches "^\\(?:[^\\]+\\)+\s*(?:,\s*\\(?:[^\\]+\\)+)*$" and try the command again.
My task was at the root level:
TaskPath TaskName State
-------- -------- -----
\ CMD Running
This pattern does not allow the use of the root of scheduled tasks: [ValidatePattern('^\\(?:[^\\]+\\)+\s*(?:,\s*\\(?:[^\\]+\\)+)*$')]
I updated my local copy of the script to use this instead: [ValidatePattern('^(\\|(?:[^\\]+\\)+\s*(?:,\s*\\(?:[^\\]+\\)+)*)$')]
This seems to have worked.
Hello,
Thank you for reaching out!
My name is William and I'm here to assist you in any way I can.
Our development team will do the modification to our GitHub template.
Also, if you find any other issues with our GitHub templates, you can also do the PR yourself and our development team will review it before it is published.
Best regards,