Is it possible to let PowerShell interact with a console application?
Let say you have any console application that is easily to start, later when the console has been running for a while maybe it outputs something in the console window and wait for user interaction. Is it possible to let PowerShell answer to this output?
So this is what I want to do in PowerShell:
- Start MyApp.exe
- Wait for some output
- Depending on the output p开发者_Go百科rovide input to MyApp.exe
You can use the normal .NET APIs for that from PowerShell, i.e. Process.Start, getting input and output stream of the process and act on that accordingly. Directly it is not possible.
精彩评论