PowerTip: Return a status code to Linux from PowerShell
Summary: Pass a result code back to a calling Linux environment from Open Source PowerShell.
How can I pass a numeric value back to a calling Bash Shell to indicate an error?
Just simply supply the EXIT command and a numeric value at the point where the error is flagged. For example, the following code is a PowerShell script that returns a value of 76 if the script does not match the value of
If ($Value -eq ‘Something Good’)
Write-Output ‘It’s Good, it’s very Good’