Invoke-Expression will return all the text of the command being invoked.
Invoke-Expression
But how can I get the system return value of whether this command has been exec
I found a simple way to do it, which keeps STDOUT in tact.
$Expr="MY EXPRESSION" $Expr += '; $Success=$?' Invoke-Expression $Expr
Success is now True or False, and all IO remains intact.