Trigger "JobCompleted" not working

Product: PowerShell Universal
Version: 2.8.3

I have this trigger, to run when another script has completed (I want one script to run, then trigger the next to run) but it’s just not triggering at all?


As you can see, it runs fine if I invoke it manually.

Bump…

I’m having the same issues on 2.10.2. I can’t get any triggers to run at all. I’ve tried delays and most others but nothing.

Edit: I figured out my issue and it seems like the triggers configuration isn’t reading the folder hierarchy if you have your script repo setup to use any kind of folder depth below the default Automation directory. I had to go into my Triggers.ps1 file and manually update the script to include the directory of my script

Old:

New-PSUTrigger -Name "Chk" -Script "Script1.ps1" -EventType "JobStarted" -Environment "Script Environment" -TriggerScript "Script2.ps1" -Delay 16

New:

New-PSUTrigger -Name "Chk" -Script "Script_Directory\Script1.ps1" -EventType "JobStarted" -Environment "Script Environment" -TriggerScript "Script_Directory\Script2.ps1" -Delay 16

I’ll open an issue for this. Thanks.

1 Like