If you actually need the output, than it's by far easiest to just run the script through the command-line shell (it has -batch argument to suppress all output except the actual results).
The .-commands are implemented in the shell, not the API. Because the API does not do output and the commands you mention are for controlling the output. If you really wanted to run the scripts with the API, you'd need to do the output yourself and either hardcode the format you want or interpret the .-commands yourself.