Intellisense in PowerShell

Recently I’ve been thinking about Intellisense (and similar features), and the impact it’s had on software development. I find that I can live without it for the few common tasks I perform all the time, but anything beyond that a lack of Intellisense is a serious productivity killer. It’s amazing how much more productive Intellisense can make me, and especially the Intellisense in Visual Studio 2005 — the auto-complete as you type is a very nice feature. Yes, I realize other tools extended Visual Studio 2003 (and earlier?) with the same functionality, but having it baked in feels cleaner, and more performant too.

This weekend I was catching up on some videos I’ve been meaning to watch, and I caught the “episode” where Jeffrey Snover (architect of PowerShell) interviewed Scott Hanselman. In the video, Scott reviewed PowerTab – an awesome tab-complete feature that MoW has written/extended. I thought, gosh, it would be nice if the list of available completions showed up like Intellisense too! Well, thoughts can be dangerous things, and sure enough I wasted most of my Sunday trying to create an “Intellisense-like” experience in PowerShell. (Aside: my wife always has to ask me if I’m working or playing, because she can never tell the difference when I’m on the computer.)

I’ve got it mostly there, with a few things I have left to tweak (showing the context menu above the text if there’s not enough room on the bottom, selecting the correct items as the user continues typing, and apparently my additions broke a few tab-completion scenarios). Check out the screen-cap for a preview of what’s coming…

This entry was posted on Monday, March 5th, 2007 at 2:44 am and is filed under powershell. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “Intellisense in PowerShell”

  1. Anonymous Says:

    Really cool!

    A feature request: filtering the completion list based on uppercase letters.
    This idea is implemented successfully by wholetomatos visual assist for c++ and is very handy.

    For example with the list

    TabExpansionDoubleTabEnabled
    TabExpansionAlternateHandler
    TabExpansionBorderColor
    TabExpansionFilterColor
    TabExpansionDefaultHandler

    typing TEDH would select TabExpansionDefaultHandler.

    This could be preprocessed so that it would not take up time during completion.

    Keep up the great work!

    Regards,
    Staffan

  2. /\/\o\/\/ Says:

    Cool !,

    I was thinking of it also, but (did think I) needed an STA Thread for the Combobox in autocomplete mode,

    I have made aa working POC in IronPython, but had no time to work it out further..

    So also realy looking forward to your solution.

    Greetings /\/\o\/\/

  3. Jeffrey Snover Says:

    Drool drool drool!
    I can’t wait to try this out.

    Jeffrey Snover [MSFT]
    Windows PowerShell/MMC Architect
    Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
    Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Reply