0

I have a windows user data script that references a bunch of other ps1 scripts.

In one of the scripts I am trying to schedule a job, that will run on start up. This job has an action of triggering another ps1 script on startup.

However, all my other scripts are executing fine. But the script that creates a new schedule job isn't getting executed.

After restarting the ec2 (post user data execution), I am 1st checking if the job is scheduled. It's not. So, i have to manually trigger the scheduleJob script, then restart. After doing the steps manually, the job is triggering properly and running my PostStartUp script.

As far as I know, user-data scripts are run as admins, so this doesn't seem to be a privileges issue.

Thanks in advance.

MayMay
  • 1
  • Can you give more details on the script and problem you are trying to solve. Also on another note any specific reason you not using the SSM to run the power shell scripts, it is much easy to control the lifecycle that way instead of user data script. – Vikram S Feb 02 '23 at 06:20
  • Show us the user data – Paolo Feb 02 '23 at 07:45

0 Answers0