Invoke-Expression will return all the text of the command being invoked.
But how can I get the system return value of whether this command has been exec
In PowerShell you can evaluate execution status by inspecting the automatic variables
$?
Contains True if last operation succeeded and False otherwise.
and/or
$LASTEXITCODE
Contains the exit code of the last Win32 executable execution.
The former is for PowerShell cmdlets, the latter for external commands (like %errorlevel% in batch scripts).
Does this help you?