Is it possible to set custom return codes with powershell steps?

Comments

3 comments

  • F V

    Sure, just state -1 or -12 or whatever in your condition like 

     

    }else{Write-Debug "Can't find signature for $PCUsername"}
    -12
    }

     

    PDQ will dispay your error somthing as like "powershell returned -12" and you will know error 12 hapenned

     

    Hope this helps

    1
    Comment actions Permalink
  • Colby Bouma

    F V

    That didn't work in my test. I always use "Exit" to throw error codes:

    Exit -12
    2
    Comment actions Permalink
  • F V

    Just checked my Script, You are right, you have to use Exit <error code>

     

    0
    Comment actions Permalink

Please sign in to leave a comment.