Hi,
I am using this exec() function ( PowerShell Exec function from psake · GitHub ) in my script where I have couple commands which I am using with this function.
When I am using the function, and create an error in one of the commands - the script continues to execute - it does not fail on the error.
I created another script where I am not using the function and I created an error ( delete some file etc. so I can produce an error):
ex.
& gulp clean
if (! $?) { throw “Gulp clean failed” }
& gulp build
In this case, the script fails and it does not continue on the other tasks - ( task gulp build is skipped)
On the other hand,with exec() function,
ex.
In this case, it gives the error on the screen but continues to run the script with the other tasks - for example continues with gulp build.
How can I resolve this issue and make it stop executing on the first error just like it does when not using exec() function?
Thank you