I want to have access to the same message that Powershell prints when you send an error record to the output stream
Example:
This is the excep
Similar to @tomasr, but shorter:
$($error[0])
For all errors in a script:
$($error)