I'm trying to capture and display the exit code of a batch (.bat) script that is called within a powershell (.ps1) script. I'm new to power shell scripting. Greatly appreciate if you can provide any inputs or sample code on how this could be achieved.
Below is the .bat script that is being called with various parameters from the .ps1 script. How do I capture and display the exit code of this istool.bat script?
.\istool.bat glossary export -dom serverhostname:9446 -u user -p password -filename "c:\exp_polrules.xml" -allpolrul
Wow, that's funny. There is someone with the exact same problem as you ... 😉
You don't show how you are capturing the error in the batch file or even how you are exiting the batch file.
So, something like..
cmd /c dir x:\
cmd /c dir c:\
Directory of c:\
See details here:
You must be logged in to reply to this topic.