简体   繁体   English

与Powershell控制台连接以嵌入我的应用程序中的运行空间

[英]Connect with Powershell console to runspace embedded in my app

I'm trying to embed PS in my .NET app to make part of object model easily discoverable and have the ability to navigate it. 我试图将PS嵌入我的.NET应用程序中,以使对象模型的一部分易于发现并具有导航能力。 It is easy to create runspace, prompt user for some script as plain string, run the script in the runspace and output something to the user. 创建运行空间很容易,以纯字符串形式提示用户输入一些脚本,在运行空间中运行脚本并将某些内容输出给用户。 But in that way it lacks interactivity - user doesn't get auto-completion, IntelliSense, tooltips etc, thus he is required to issue Get-Members constantly just to know what he can do with given objects. 但是以这种方式,它缺乏交互性-用户不会获得自动完成功能,IntelliSense,工具提示等,因此,他需要不断发出Get-Members才能知道自己可以使用给定的对象做什么。

As I understand interactivity is provided by PSHost thing. 据我了解,交互性是由PSHost提供的东西。 Is it possible to go without implementing it manually in the application, but rather expose embedded runspace somehow, so I can connect to it with PowerGUI for example? 是否可以不用在应用程序中手动实现它,而是以某种方式公开嵌入式运行空间,以便例如可以使用PowerGUI连接到它? Enter-PSSession or something alike. Enter-PSSession之类的。

我很确定您将必须实现自己的制表符补全,就像由PowerShell Host那样。

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

相关问题 我们可以在 .net 控制台应用程序中的运行空间内执行 az PowerShell 模块命令,该控制台应用程序部署为 Azure 应用程序服务上的 Web 作业吗? - Can we execute az PowerShell module commands inside of a runspace in a .net console app deployed as a webjob on Azure app service? 如何将嵌入式PowerShell运行空间公开给远程处理 - How can I expose an embedded PowerShell runspace to remoting 为什么我在尝试使用.Net PowerShell Runspace 连接到我的本地 Windows 10 机器时会出现异常? - Why do I get exceptions when trying to use .Net PowerShell Runspace to connect to my local Windows 10 machine? PowerShell 运行空间与 DLR - PowerShell Runspace vs DLR 创建RunSpace时如何使用PowerShell 2或3? - How to PowerShell 2 or 3 when creating RunSpace? 在 .Net 中保持 Powershell 运行空间打开 - Keeping Powershell runspace open in .Net PowerShell中的流程vs实例vs Runspace - Process vs Instance vs Runspace in PowerShell 使用Powershell中的异步API运行空间issus - Runspace issus using async APIs from Powershell 将Powershell模块添加到Runspace asp.net - adding Powershell Modules into Runspace asp.net 控制台应用程序如何连接到 Azure SignalR 服务器以从我的 Web ZDB974238714CA8ACE4DA 获取通知 - How does a console app connect to Azure SignalR Server to get notifications from my Web API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM