Scripting Games

Scripting Games
Don Jones
Scripting Games

20115-September Scripting Games Puzzle

Our September 2015 puzzle is another one-liner, to help get you out of Summer Mood and back into Work Mode. This time, it’s a pretty real-world scenario, designed to test your understanding of the pipeline and how data can be manipulated within it. You’ll need to really grasp pipeline parameter binding to make this work in the shortest command possible.

Don Jones
Scripting Games

2015-August Scripting Games Puzzle

Our August 2015 puzzler tests your ability to retrieve data from the Web. If you’ve never done this before, it can be a real brain-bender - but don’t overthink it; experts can probably pull this off in a one-liner if they’re using a newer version of PowerShell!

Don Jones
Scripting Games

2015-July Scripting Games Wrap-Up

The July puzzler wasn’t intended to break your brain - but it was intended to highlight an extremely important pipeline technique - and to make you think about how PowerShell parses command lines. Let’s begin with our Celebrity Entry, from Boe Prox. We think you’ll discover some interesting new techniques in this answer - and learn from understanding how he got there.

Celebrity Entry

The 2015 Scripting Games have started and have taken a different route this year in that we are they are running a monthly puzzle vs. the usual format. That being said, I was asked to be a celebrity contestant and put together my solution as well as adding my thoughts (I promise to try and stay on a clear path) and various routes that I took to get to my final solution.

Don Jones
Scripting Games

2015-July Scripting Games Puzzle

Our July 2015 puzzler is designed to make you really think about the PowerShell parser. Normally, you can more or less ignore the parser, because if you’re typing best-practice, long-form code (no aliases, spell out parameter names, etc), the parser deals really well with everything. But knowing how the parser works is useful, because when you get into tricky syntax, the parser can be harder to work with. So we’re going to test the limits of the parser’s patience - and your skills!

Don Jones
Scripting Games

The Scripting Games: Here's What's Happening

I know a lot of folks have been wondering about when the next Scripting Games will be. It’s a complicated answer… so bear with me for a minute while I unburden my soul to you. If you prefer to just skip the explanations, you can skip a bit to see what we’re doing, part 1.

The Background

I’m not sure how long Microsoft’s Scripting Guys ran The Scripting Games, but it goes back at least to 2006. Back then, the focus was on VBScript, it wasn’t until a year or so later that a parallel PowerShell track was started, and another year or two before VBScript was discontinued. The Games back then were… well, games. They weren’t always terribly real-world, but they were fun, and they made you think.

Don Jones
Announcements

Design the Next Scripting Games

We have some folks working on the next Scripting Games… but we want some feedback from the community to make sure we’re offering something of value.
The current plan is to run a series of events, with both Beginner and Intermediate tracks. There will be no “advanced” track; the feeling is that, if you’re advanced, you should be helping out by judging ;). Events will be constructed as a combination of puzzles and real-world tasks, meaning some things will simply test your PowerShell skills, while others will test them in a more production-applicable way.
What we need from the community is some sense of what you want to get from the Games. However, before you reply, understand what is NOT on the table: we will not be running an event where every entry gets personal commentary or feedback from an expert judge. It simply isn’t practical - everyone doing the judging has a full-time job, and offering personal feedback just isn’t feasible.
What COULD be on the table is offering a numeric score from a judge, based on the completeness of your entry and what the judge thinks of it. However, if it’s a low score, you’re not going to be told why (“no commentary,” see above). So we’re not sure that numeric scores are useful.
One proposal has been to post the events, and have judges select both good ones and less-good ones to write about. In other words, provide commentary on the outstanding entries, but not EVERY entry. Individual entries wouldn’t receive a score, but you could certainly compare what you did to the outstanding ones that did receive commentary. The idea here is to give you a task on which to test your skills, and to provide some educational feedback on some representative entries. The fact is that, in any given task, we tend to see a lot of similar-looking entries anyway, so hopefully taking some of them and commenting (both positively and constructively) will help everyone “judge” their own entries and improve their skills.
After trying numerous approaches to the Games over the past years, and after listening closely to people’s feedback, we’re trying to come up with something that is both useful and do-able.
What do you think of that proposal? Or, would you offer another proposal for us to build the Games around? Keep in mind - any proposal that suggests “expert commentary on every entry” will simply have to be turned down outright. After major discussion, we simply can’t commit to it. We’ll leave this open for the month of February 2015 - discuss away!
Add to the discussion in the Forums. Login required; not accepting comments on this post.

Don Jones
Scripting Games

Julie's Comments: The Scripting Games – Winter 2014

This post comes to us from Julie Andreacola, one of the members of team Kitton Mittons, who won The Scripting Games - Winter 2014. You’re welcome to submit your thoughts about the Games as well!__
The 2014 Scripting Games are over and once again, it was a terrific experience. This was my third scripting games and I was blown away with all that I learned.
The team approach was very appealing to me as I have been the PowerShell expert at my workplace so I was hoping to find a team where someone knew more than I did as I’m only intermediate in PowerShell skills. I struggled to put a team together from our local PowerShell user group for the practice event, but it just didn’t work out due to the timing and workload of potential team members. I took to Twitter to find a team that had an open spot and found the Kitton_Mittons.
The team was just what I needed. We had no expectations to win and we acknowledged that some weeks, people would not be able to participate. All of the team, but myself was located in Northern Virginia, so we arranged for a Google Hangout each evening around 7 p.m. We also had a shared repository on GitHub. Both of these tools were new for us, but were invaluable for our team collaboration. I think we only had one night with everyone in attendance. The sessions varied from discussion of elements of the script, screen sharing (nice Google Hangout feature), and general geek conversation. Two of the team traveled to Charlotte NC to join me in PowerShell Saturday 007 where we met and gained another team member for the final few events.
The learning benefits happened immediately. The first week I learned more about parameters and using them to validate inputs. I immediately began implementing them in my scripts at work, making them more robust and easier to hand off to others as I was transitioning to a new job. A couple days later, our team made our first module. I knew it was easy, but had never done it and now my script at work had a module. One of our team members made an install script that put the files and modules in the correct places. I realized the advantage of this especially when turning scripts over to users unfamiliar with PowerShell. I was able to take the same installer script and quickly customize for use in my workplace. The following weeks included getting more experience with efficiencies of script blocks and better error checking. Although many of my evenings were being taken up with PowerShell, I found the nightly sessions invaluable as our team leader, Jason Morgan, took the time to teach and explain the more complex aspects of the scripts.
The 2014 Scripting Games exceeded my expectations and truly advanced my skills. I also have a new network of System Center IT Pros. I’m starting a new job this week and I know what I learned and gained over the last 4 weeks will help me to excel in this new position. A big thank you to my team mates, coaches, judges, and the PowerShell community. Learning can be fun!

Richard Siddaway
Scripting Games

Closing the Games

The judging is complete for the fourth and final event in the 2014 Winter Scripting Games.
This Games was something very different in that we presented 4 we complex scenarios that were designed to be as close as possible to the type of tasks you may have to perform at work. The solutions required multi-file answers - there’s no way you could solve these with a one liner!
All of the teams that submitted entries rose to meet the hardest challenge I’ve seen in a Scripting Games - and I’ve taken part of judged all but the first Games.
All entries were scored by 2 judges with the judges being rotated to ensure that all judges scored each team in at least one event.
I’d like to thank the judges for their hard work and also thank the coaching team put together by Mike Robbins - most of all I’d like to thank all of the teams that entered for taking part.
In any Games we have winners and the winning teams from these Games are:
1.Kitton Mittons with 19.375 points (8 of 8 scores received)
2.TecHaH with 18.75 points (8 of 8 scores received)
3.Schnipersons with 18.5 points (8 of 8 scores received)
Congratulations to Kitton Mittons for winning the 2014 Winter Scripting Games - if a representative from the winning team could please contact Don Jones or myself we’ll see about getting your prizes to you .
The Games are closed. .
Until the next time.

Don Jones
Scripting Games

What Should The Scripting Games Look Like Next Time?

If you’ve been following along with The Scripting Games over the past couple of iterations, you know that we’ve been trying some different, new things. This Winter Games, we did a team-based series of events that threw some really complex scenarios at you. However, we know some folks would like to see the next Summer Games include a less-complex track that perhaps includes a focus on one-liners.
(Not that one-liners are an essential part of a work environment, but they’re fun and a good competitive thing - this is games, after all.)
So we’re looking for your ideas. Drop a comment, and tell us how you think the next Games should be structured.
**However, before you comment, **understand that judging by official, expert judges gets extremely difficult. Multiple 10 events across 250 entries and you’ve got a _metric butt _tonne of work for our volunteers to do. Quite frankly, it’s unlikely we’ll be able to provide a score-per-entry with that kind of volume. The folks who do judging just can’t take that much time off work. Seriously, even if a judge only had to look at an entry for 2 minutes, that can easily be more than 80 hours of work to look at every entry. It just isn’t do-able.
So, in your comment, include some thoughts on what you’d like to see for the judging/scoring side as well, keeping in mind the desire of judges to also have family lives and jobs. What’s your real goal in participating in the Games? To get community feedback (comments) on what you’ve done? We can arrange that. Is it perhaps educational to have judges pick out “noteworthy” (both good and bad) entries and comment on them, as a learning guide? Or are you solely after having a “known” expert offer commentary on your entry - which isn’t something we can guarantee if there are a large number of entries?
Help us understand what you’re in it for, and give us some ideas for creating a Summer event that’s _fun, _as well as educational.

Jonathan Medd
Scripting Games

Testing for the Presence of a Registry Key and Value

There are a number of different ways to test for the presence of a registry key and value in PowerShell. Here’s how I like to go about it. We’ll use an example key HKLM:\SOFTWARE\TestSoftware with a single value Version:
Click here to be redirected to the original post of this article on the author’s blog site where you can read the remainder of the article.