PowerShell 2 CTP3 ISE 的自定义读取主机对话框
是否可以将自定义对话框挂接到新的 PowerShell ISE(集成脚本环境)中,以取代现有的 .NET WinForms 对话框。 我说的是 Read-Host
cmdlet 启动以请求用户输入的对话框。
Is it possible to hook a custom dialog into the new PowerShell ISE (Integrated Scripting Environment) that replaces the existing .NET WinForms dialog. I am talking about the dialog that the Read-Host
cmdlet launches to request for user input.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
例如,请参阅以下网址:
http://www.microsoft.com/technet/scriptcenter/ resources/pstips/feb08/pstip0208.mspx
函数 read-host {
复制
现在,如果您调用 read-host,您将看到一个新的 Windows 窗体。
现在,如果我打开其他窗口,它仍然位于顶部,但似乎它不是最顶部的,因为我在其他所有窗口上看到它,但仍然需要单击它才能使其处于活动状态。
For example, see this URL:
http://www.microsoft.com/technet/scriptcenter/resources/pstips/feb08/pstip0208.mspx
function read-host {
}
Now, if you call read-host, you're going to see a new Windows Form.
Now, if I open other windows, it remains on top, but it seems it is not the top-most because I see it over everything else, but still need to click on it to make it active.
您可以做的是创建一个覆盖 Read-Host 的自定义函数,这样您就可以有效地篡夺 Read-Host 并替换您自己的功能。
What you CAN do is create a custom function that overrides Read-Host, so you're effectively usurping Read-Host and subbing your own functionality.
我不相信你可以,不。 您需要编写自己的托管应用程序。 ISE 确实有自己的对象模型 - 我问你所追求的是否可能。
I don't believe you can, no. You'd need to write your own hosting application. The ISE does have its own object model - I'm asking if what you're after is possible.