I'm writing an embedded powershell host in C# using VS13 (Windows Application NOT console app). I can invoke powershell commands just fine. The issue I'm having is that when the invoke function handles a console command like ping, netstat, etc. it triggers an instance of conhost.exe to be created. This is normal behavior for Windows 7 and above from my research so far, but when conhost starts up, it briefly flashes a console on the screen.
Is there a way to have conhost start-up without flashing the console window initially? Keep in mind that I'm handling user input into the powershell pipeline so testing for each command, and starting a new process is probably not practical.
It's been a while since I asked this question so I wanted to share the answer I came up with. Basically, since my embedded host was in an application that runs solely in the background, there was no way to prevent conhost from flashing on the screen when "native commands" were processed. It's just the way Windows works. If my host was attached to a GUI then I think there might have been a way to redirect output, but so far for my use case I couldn't suppress conhost.