4 ms·
Disclaimer: I'm inexperienced with bash and powershell. I just converted a bash script to a powershell script. Some things are a lot easier (like writing error
by pragmatick 4y ago
Disclaimer: I'm inexperienced with bash and powershell.
I just converted a bash script to a powershell script. Some things are a lot easier (like writing errors or info messages in different colors). But I had a lot of problems getting the exit codes from maven calls to determine the exit result. Checking for 0 in shell works fine all the time, in powershell checking $LASTERRORCODE works sometimes but not always. I'm using try catch now but it's a bit of a hassle (which is ironic, comic from a java developer).
- majkinetor 4y ago$LASTERRORCODE is not the same as $? It works only on native executable errors. Some executables like git also write logs on error stream (this is a problem on linux too).