Well, it’s been awhile since I posted anything, and this causes me angst. I’ve been spending all of my time lately on PoshCode.org — not writing content, but working on a new Asp.Net MVC-based back-end (on codeplex) — but in the meantime, this month PoshCode.org finally passed this site’s raw pageview count, and it made me realized I hadn’t posted anything in a long time.

I have a whole stack of PowerBoots demos that I’ve been promising various people that I would post, so I figure I really ought to start putting them up, even if I don’t feel like I have time to properly explain them.

A few in particular don’t need much explaining, so lets start with a couple of those. A while back I wrote a kitchen timer function in response to Hal Rottenberg’s one liner and recently I had cause to pull that out to help my kids take turns playing computer games on Up to Ten … but I needed something a little more visible for their sake.

So I converted my old script to a new PowerBoots-based version with large numbers and a gradient brush that slides across and turns the whole thing to red text as the end of the time get’s closer and closer:

2 Responses to “A WPF Countdown Timer in PowerShell 2.0”

  • Very cool!

    I had to remove the BitmapEffect from line 122 to get it to work on my machine, though. I was getting an error about ‘OuterGlowBitmapEffect’ not being recognized. Works great on my machine without it though!

    • Yeah, sorry about that … you just need to add OuterGlowBitmapEffect to the list of things that PowerBoots loads … the complicated but easily permanent way is to make a file in the powerboots folder called: “PresentationFramework^System.Windows.Media.Effects.Proxies.txt” and put “OuterGlowBitmapEffect” (without quotes) on a line by itself in that file. Of course, you probably want to go ahead and also add “BevelBitmapEffect”, “BitmapEffectGroup”, “BlurBitmapEffect”, “DropShadowBitmapEffect”, “EmbossBitmapEffect” to that file too ;-)

      In the next release you won’t need to add these, ‘cause they’ll be there by default, plus the Add-BootsFunction function which you can use now, will be a permanent step so you won’t need to keep running it over and over ;-)

      Add-BootsFunction System.Windows.Media.Effects.OuterGlowBitmapEffect