Ok,
We are getting into some areas of deficiency in powershell I think !
ymmv depending on powershell version but 2 Things for you to try.
Below is on VisualCron 7.7.7.
1) Change Your Command Line to force it to run it as a file rather than the default command . . . so your parameter line now looks something like:
-File "C:\Batch\Test3.ps1"
rather than just
"C:\Batch\Test3.ps1"
You *May* Get your Exit Codes now straight out of the box, as *many* values are also defined in the Windows (Default) Exit Code Collection.
But using this collection everything but a zero is a bust . . . so depending on your scripts / exit codes see below.
2) But now you can also tell VisualCron what return codes you are expecting using an Exit Code Collection and what action you want.
So :
a) Go Into the On Error Tab in the Execute Task
b) Observe Exit Code Collection - Windows (Default)
c) Click on the 'Gears' Button to the Right
d) Click on Collection and Choose Add and Give Your Collection a Name
e) Setup Your Expected Error Codes and also whether they are a Warning (Result: Success) or Error (Result: Failure) - This controls how you want VisualCron to Handle it.
Go Back and set that Exit Code Collection for this Task in the On Error Tab (it should now be an option in the drop down) and give it a try.
As shown above . . . if you dont specify a value in your collection, or use the Windows Default and exit with as a 40 which isn't set then you will get the default behavior specified on this page 77777
You can also use this technique for unusual return codes from other exes (like Robocopy).
i.e. We have an Exit Code Collection for RoboCopy as some of the Exit Codes > 0 are warnings / extra information on a success rather than an error so the standard Windows (Default) Error Collection is not cool.
Cheers
Kevin
Edited by user
2015-11-01T05:18:59Z
|
Reason: Error Code Collection - Value Not Specified then 77777