As a simple example, let's say I'm using a PowerShell Step in a SQL Sever Agent job to check for the existence of a file.
If the file does not exist, how does the PowerShell Step signal to the Agent Job that the step failed so that Agent can retry the step according to the step's settings?
I could just let PowerShell loop and sleep until the file arrives but I want to use SQL Agent as it was intended and have it handle failure and success and retries and continue to this step on success or that step on failure, etc.