Console Application (Non) Support in the ISE

Console Application (Non) Support in the ISE

  • Comments 7

There are some limitations on how the ISE interacts with console applications you need to be aware of, for apps like ftp and netsh.

First of all, the ISE Runs console apps that don’t require user input just fine.
For example, “ping www.microsoft.com” and “cmd /c dir /s”

Piping also works fine in the ISE,
For example, PS C:\Users\ibrar> "show mode" | netsh
netsh>online

Automation in scripts, that don’t require user interventions should be fine.

However, if you run “cmd /k” which requires input, the ISE will be stuck, and you’ll have to stop the pipeline, using Ctrl-Break or pressing the stop button.

It can get annoying, and it’s slightly less annoying to get an error. If you run cmd, or netsh, you get,

Cannot start "cmd ". Interactive console applications are not supported.
To run the application, use the Start-Process cmdlet or use "Start PowerShell.exe" from the File menu.
To view/modify the list of blocked console applications, use $psUnsupportedConsoleApplications, or consult online help.
At line:0 char:0

You can call $psUnsupportedConsoleApplications.Add to add commands accidentally typed into the ISE, like ftp which is not on the list.

The other way to do it, is to be conscious and do “start ftp.exe” (start is an alias to start-process)

This will launch it into a new window, and not block the ISE. Some customers have done things like

function vim { start-process vim $args }

This will ensure that vim will launch with the filenames that you specify, even when ran in the ISE. It’s a very good thing to keep it in your $profile

And if you really need a console, you can always launch PowerShell using Ctrl-Shift-P or press the PowerShell icon in the command pane

Hope this helps,
Ibrahim Abdul Rahim
[MSFT]

Leave a Comment
  • Please add 6 and 1 and type the answer here:
  • Post
  • PingBack from http://www.clickandsolve.com/?p=3635

  • Specifically regarding ViM, I solved this by opening gvim.exe with multiple files in separate buffers:

    function vim {gvim.exe -o1 $args}

    Of course, if you prefer tabs and have vim 7 you can open files in multiple tabs:

    function vim {gvim.exe -p $args}

  • Here is a collection of differences between the PowerShell_ise.exe and PowerShell.exe, as well as workarounds

  • Here is a collection of differences between the PowerShell_ise.exe and PowerShell.exe, as well as workarounds

  • This is a bit annoying, as I use interactive console applications very often.

    I don't understand why Console2 (sourceforge.net/.../console) and ConEmu (code.google.com/.../conemu-maximus5) are able to figure this problem out, while Microsoft hasn't. I guess I will continue using them while I wait for the ISE to catchup.

  • Are there any plans to add support for this in the future?

  • Any update?   I presume the reason ConEmu and Console2 work is that they are not WPF-based?

Page 1 of 1 (7 items)