added option to capture output from RunCommand