powershell-universal icon indicating copy to clipboard operation
powershell-universal copied to clipboard

5.0.11 - Trigger After Script finishes with Warning

Open ErvM opened this issue 1 year ago • 5 comments

Version

5.0.10

Severity

Medium

Environment

msi

Steps to Reproduce

Not sure if this is a bug or feature request. Create a trigger that runs once a script finishes. The script completes successful but it's in a warning state because the module that I am using is just noisy.

Expected behavior

Trigger kicks off when script finishes.

Actual behavior

The trigger doesn't run, I think because the script/job finished in a warning state.

Additional Environment data

5.0.11

Screenshots/Animations

No response

ErvM avatar Oct 15 '24 17:10 ErvM

This should work. I tried myself and didn't see this behavior.

image

New-PSUTrigger -Name "Trigger" -EventType "JobCompleted" -TriggerScript "TriggerScript.ps1"

I just have a Write-Warning call in a script to cause the trigger to take place.

adamdriscoll avatar Oct 15 '24 21:10 adamdriscoll

I have some more details @adamdriscoll

Here is my trigger -

image

Here is the script either being kicked off by a schedule (manually triggered) or manually running the script. Nothing runs after it.

image

emoeckel avatar Oct 15 '24 22:10 emoeckel

I was able to reproduce in our test suite but only when I had another trigger that had a script that was missing. Can you check your log for any errors referring to triggers?

adamdriscoll avatar Oct 16 '24 17:10 adamdriscoll

@adamdriscoll I don't see any error in Platform > Logging for triggers. The only errors that I see are my own caused errors with APIs and credentials etc... I only have the one trigger currently that I have been trying to make work. However, maybe this could be related? I am having issues calling any environment that is not integrated, even including Agent. I am going to make an issue with those details.

emoeckel avatar Oct 16 '24 18:10 emoeckel

Disregard the above statement about other environments not working, it's due to Run-As, probably bad creds etc... But the trigger issue is still an issue.

emoeckel avatar Oct 16 '24 18:10 emoeckel