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.
Asked
Active
Viewed 1,722 times
2

GEOCHET
- 21,119
- 15
- 74
- 98
3 Answers
3
For example, see this URL: http://www.microsoft.com/technet/scriptcenter/resources/pstips/feb08/pstip0208.mspx
- Drop the full code into Notepad.
- Add the first line: function read-host {
- Add the last line: }
- Copy all the contents from Notepad.
- Paste it all into your PowerShell console.
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.

Marco Shaw
- 1,117
- 6
- 13
2
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.

Don Jones
- 9,367
- 8
- 39
- 49
0
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.

Don Jones
- 9,367
- 8
- 39
- 49