The 2008 Winter Scripting Games

Windows PowerShell 2.0 Challenge

The Windows PowerShell 2.0 Challenge


So how easy is it to win a prize in the 2008 Winter Scripting Games? Well, what if we told you that you can win a limited-edition Windows PowerShell T-shirt just by submitting an event solution that uses Windows PowerShell 2.0?

Well, OK, that’s a good point: if we told you that then we’d be lying. As it turns out, you can’t get a T-shirt just by using Windows PowerShell 2.0. However, you can win a T-shirt by submitting an event solution that uses one of the new capabilities built into PowerShell 2.0. For example, you might use some of the new array capabilities (like split and join) in your script. (Hint: As it is, there’s a good chance you’ll need to use an array or two in several of the Scripting Games events.) You might find a use for some of the new parameters added to the Select-String cmdlet. You might be able to take advantage of the DATA section that makes it easy to localize scripts, or find a way to use Script Cmdlets to handle command-line arguments. (Hint: There’s a good chance you’ll need to use command-line arguments in several of the Scripting Games events.) That’s entirely up to you.

Oh, what the heck. Here’s a sneaky way to earn yourself a T-shirt: output your data using the new Out-GridView cmdlet. In the Advanced division, you can use Out-GridView (as opposed to the console window) for the following events:

Event 2, Skating on Thin Ice

Event 6, Prime Numbers

Event 7, Play Ball!

Event 8, Making Beautiful Music

For the Beginners division, you can use Out-GridView for these events:

Event 2, True Type

Event 6, Coffee Break

Event 9, Pool Party

For better or worse, we’re limiting Out-GridView to these events; for all the other events please use the console window.

Note. Why? Well, in some cases the console window is the only thing that makes sense; in other cases, it makes it much easier for us to test the scripts.

A few things to keep in mind here. First, there’s a limit of one shirt per customer. On top of that, shirts are also limited to stock on hand; we have around 100 shirts (in various sizes), and once those are gone there is absolutely no chance that we’ll be able to get any more. (That’s why we called these the “limited-edition” PowerShell T-shirts.) This means that shirts will be handed out on a first-come, first-served basis. Which also means that you might want to try to slip a PowerShell 2.0 feature into one of your earlier submissions, before the shirts are all gone.

Second, any feature of PowerShell 2.0 you employ in your script must be an integral part of the script. For example, the Get-WMIObject cmdlet has been beefed-up for PowerShell 2.0; however, if a script doesn’t need to use WMI then you probably aren’t going to get credit just because you randomly stuck Get-WMIObject in there. The Scripting Guys will have the final say over whether a PowerShell 2.0 feature was used legitimately. We’ll be pretty lenient, but still ….

Finally, during the Scripting Games the Scripting Guys don’t have time to read every line of code in a script; in general we simply run the script and see whether or not it works. That means that you could use a PowerShell 2.0 feature in one of your solutions and we might not even realize it. The best way to avoid that problem? When you submit an entry for the Scripting Games you’re asked to enter your name or nickname; the country you’re representing (optional); and the user group you belong to (also optional). A typical entry would include this information:

Ken Myer
United Kingdom
Edmonton Microsoft User Group

To get credit for using PowerShell 2.0 (and to have a chance at winning a T-shirt) just add a fourth line, one that indicates you used a PowerShell 2.0 feature:

Ken Myer
United Kingdom
Edmonton Microsoft User Group
PowerShell 2.0

That’s all you have to do. If you have any questions about the Windows PowerShell 2.0 Challenge just send email to scripter@microsoft.com (in English, if possible).


Top of pageTop of page