I'm working at the moment with a PowerShell script calling a C# console application, but I'm curious if there's a general solution.
Basically, my script loops over some files, prints out something for each one, and calls my program. Everything works, but what I'd like to do is have my console program's output show up indented by one tab stop. Right now I've managed that manually (just "hard-coding" the tab stop in my Console.WriteLine() statements), but that's hardly ideal from a maintenance standpoint, since sometimes this program will be run on its own.
An example of what I'm looking for is
powershell output file #1
c# program output
c# program output
powershell output file #2
c# program output
c# program output
Would it help to use a dedicated logger class? It would also be slick to do different colors for the called program, but I'd settle for a non-intrusive way to do indentation. In particular, a solution that avoids the necessity of editing the called program (e.g. for third party code I don't have source for) would be preferred.