Is it possible to fake windows console api?
问题 I've written a ssh server in c# and I thought it'd be neat to hook up powershell as a shell. I've tried 2 methods to get this to work properly but both are far from perfect. Here's what I've tried: Launch powershell.exe and redirect it's std(in/out). This doesn't work well since powershell.exe detects it is redirected, changes it's behaviour. What's more, it expects input data on the stdid, not commands. So it uses the console api to read commands. Host powershell in a "wrapper" application.