title: C# cmdlet - Passing returncodes to the pipeline
body: <p>I need to convert a little C# application which is being used as an interface between two systems to a PowerShell cmdlet. The first system is calling the application with some parameters and gets back one of a couple of return codes like 0 for success or 1000 or 1001 for specific errors.
  Currently the cmdlet I've written is passing the return codes back to the pipeline with WriteObject(). My question is if there is a better way to do this espacially if the return code wasn't 0 and an error occured? </p>
  
  <p>Thanks in advance for any suggestions!</p>