PowerBoots – Shoes for PowerShell

If you haven’t seen the Ruby Shoes graphical framework, you should check it out. In fact, go read the tutorial and come back, because the rest of this will make a lot more sense then.

It’s a very slick toolkit, right? Not only that, but it works on Windows, Linux, and Mac OS X … unlike what I’m about to show you, which works only where PowerShell works …

So, I’m curious if anyone would like something like that for PowerShell … and more to the point, how many people would be interested in it, and whether anyone would be willing to help write it (because exposing all of the properties of the various controls is going to require a lot of repetitive coding).

What would it look like in PowerShell?

The simplest PowerBoots app

The simplest PowerBoots app


# These lines are the same (#2 uses aliases)
New-Button "Push Me" | Out-WPF
button "Push Me" | Wpf
A few more buttons, in a stack

A few more buttons, in a stack


# Again, these lines are the same (#2 uses aliases)
"A bed of clams", "A coalition of cheetahs", "A gulp of swallows" | New-Button | New-Stack | Out-Wpf
"A bed of clams", "A coalition of cheetahs", "A gulp of swallows" | Button | Stack | Wpf

As a disclaimer, I copied the examples here from the Shoes tutorial I mentioned earlier, which is why they’re slightly kooky (Why The Lucky Stiff is a strange guy), and why I suggested you go read it before you read this. Of course, although these demos do work —and it’s all skinable and themeable— this is practically all that works in my demo, so don’t go thinking I’ve got a whole Shoes implementation for PowerShell.

A few options

A few options


"A bed of clams", "A coalition of cheetahs", "A gulp of swallows" | Button -margin 2 | Stack -margin 8 -background red | Wpf

I’m just trying to gauge the interest level — so if you’re interested, please comment below and let me know that you want it, what sorts of things you want it for (if you can think of any off the top of your head), and/or how involved you’d like to be. I’d love for someone to say: “Wow, that’s a great idea, I’m going to go finish it”, but anything short of that, right down to “I’d give you $5 to write it and give it away” is acceptable ;)

One final note: the Out-Wpf cmdlet that you see here does work in v1 and v2 and can even do this (click for the full picture):

Out-WPF without PoshConsole

Out-WPF without PoshConsole

I’ll release that later this week…

[new] PowerBoots Release

I’ve released a full script-based version of this. While it does everything you see above and more, it does not work in PowerShell 1. You can get an idea of how to use it by following the PowerBoots tutorial, and you can download PowerBoots, but for now it requires v2 CTP3. Let me hear from you if v1 support is important to ya.

Similar Posts:

11 thoughts on “PowerBoots – Shoes for PowerShell”

  1. I prefer the syntax that Doug used. But I personally would just learn WPF and use your Out-WPF.

    1. Yeah, I kind of like the ruby syntax myself … but I think the Pipeline syntax is a little more natural (and powerful) in PowerShell. Actually I'm wrestling with events at the moment, I'm not sure they work right against PowerShell when it's not in STA mode…

      The thing is, in WPF you don't have the limitations that Shoes has, so I can put an image into a button, for instance — the ruby syntax doesn't seem to accommodate that very well — it uses the same syntax (curly braces) for the default (click) handler on the button as for content on container controls. Of course, I might just be misinterpreting the significance … my Ruby is still weak.

  2. +1 I love this idea. I don't know how much help I could be on creating it, though, since I have no experience with C#. I have access to Visual Studio, though, and if you have some grunt work that you need help with (perhaps some of that repetitive coding), email me and I'll see what I can do. I would love to see this come to fruition.

  3. Not able to help out, but I'd definately be very interested in a toolkit like that :)
    Or rather, I'm not able to help out with the coding, but if you need help with anything else, I'd be willing to help out.

  4. I'd be very interested in this, especially as a possible replacement for HTAs. I might be able to help with some of it, although with the upcoming semester and work I'm not 100% sure how much time I'll have to devote to it.

  5. Hmmm.. There's also a language called REBOL that uses a dialect (DSL) to construct a GUI – This might also be another source of inspiration on how to lay things out.

    I.e

    view layout [ button "Click Me!" [print "click!" ] ]

    which is the same as writing:

    layout [ button1: button "Click Me!" [print "click!" ] ] | view

    The two concepts are much the same???

    Anyway, love using the REBOL to write quick dirty GUIs – and I'd love to use powershell to do the same thing. Ddidn't think the WPF samples on the offical powershell blog were very easy to use in comparison… Your DSL looks much better!

    Small tutorial at http://www.rebol.com/docs/easy-vid.html

    1. Hmm… That could be done, possibly as an option for PoshConsole. I wouldn’t use the fully transparent version, but I might be convinced to make it an option. Here’s what it looks like right now (when it’s not in “quake mode”):

      PoshConsole, my WPF console project

      I’ve got a release coming later this weekend.

Comments are closed.