简体   繁体   English

将输入转发到Powershell,从中读取输出,而无需用户看到控制台C#

[英]Forward input to powershell, read output from it without the user seeing a console c#

Is there any way I could have an application that acts as a different interface for a powershell prompt, like the ISE does? 有什么办法可以让我的应用程序像ISE一样充当Powershell提示的不同接口? I just want to make it visually different. 我只是想使其外观有所不同。 I'm thinking something to do with stdin and stdout, but i'm not totally sure how to make that work in C#. 我在想与stdin和stdout有关,但是我不确定如何在C#中实现该功能。 As well as the issue of hiding the console window. 以及隐藏控制台窗口的问题。

Sure you can use the PowerShell engine API to host PowerShell within a WPF or WindowsForms application. 确保可以使用PowerShell引擎API在WPF或WindowsForms应用程序中托管PowerShell。 See this MSDN topic on hosting PowerShell in your own application. 请参阅有关在您自己的应用程序中托管PowerShell的MSDN主题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM