PowerShell return values

Is there a way to detect the return value from a PS action?  I want to be able to detect exceptions from my scripts.

The only way at the moment is to log to a continua variable by generating formatted output :

[code] @@log{setvariable name="MyConfigVar", value="An Error occurred"} [/code]

Not sure where to call that from - PS or in Continua?

In your powershell script, e.g :

[code]write-host "@@log{setvariable name=""MyConfigVar"", value=""An Error occurred""}" [/code]

Super - thanks.