I have a powershell script that needs to run another .exe file as part of its job.
The .exe file itself spawns an interactive shell that I would like to write and read from mulitple times (without killing the .exe process in between).
For example, I'd like to run something like this from Powershell:
& my.exe
And then interacting with that process in the following way so I can read and write to the process's stdin/stdout of the spawned shell, which looks like this:
MY.EXE> <something sent from powershell>
<Output that powershell can read>
MY.EXE> <something sent from powershell>
<Output that powershell can ready>
etc.
And eventually kill the .exe process when I'm done.
I've played around with manual process spawning in Powershell and overriding StdIn/StdOut/StdErr, but this seems flakey at best.
Any thoughts?