capture-output

Capturing system command output as a string

Perl and PHP do this with backticks. For example: $output = `ls`; This code returns a directory listing into the variable $output. A similar function, system("ls"), returns the operating system return code for the given command. I'm talking about a variant that returns whatever the command prints to stdout. (There are better ways ...

Output from external exe and my custom objects in powershell

(Sorry for strange title, haven't come up with anything better..) Background I use nunit-console to test my assemblies. It is called like this (simplified): function Test-ByNunit { param($assembly, $tempFile = 'c:\temp\nunit.xml') & <path-to-nunit-console> $assembly /nologo /xml:$tempFile @othparam } Test-ByNunit c:\temp\myAs...