Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Error Handling… Pls Send Help

$
0
0

I have a script that runs a batch file. The batch file is throwing some errors, but runs successfully. But when the batch file throws errors, the powershell script throws an error.

Included in the output is “0 failed”. Is there a way to check to check to see if the code contains this message, and if it does then to ignore all errors?

Here is some psuedocode that might be able to describe what I am trying to accomplish:

$output=./testrunner.bat

if ($output -Like “(0 failed)”) { ignore errors }

else { don’t ignore errors }

submitted by /u/19600815
[link] [comments]

The post Error Handling… Pls Send Help appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles