What does Util.Cmd( ..., StreamResults: true) do?
I have a script which calls an external program that takes a while and writes quite a few lines to console and I thought that this option would start displaying the output at once rather than waiting until the program had finished.
Later on when I was had more throughly debugged the script I change it not to dump the output from the cmd.
But this seems to have the effect of not actually running the command!.
System.IO.File.Delete("testfile"); var output = Util.Cmd("echo hello > testfile", streamResults: true); System.IO.File.Exists("testfile").Dump(); output.Dump(); System.IO.File.Exists("testfile").Dump();
False (0 items) True
showing that the testfile is not created until after the output is dumped (or until I called something like output.ToArray())
Can anyone explain?