We’re pleased to announce the winners for Event 5 of The Scripting Games 2013!
Remember that Event 6 is now open for community voting, and that Event 6 opens up near the end of this week. That’ll be your last chance to contribute, and shortly after TechEd we’ll announce the overall winners. Good luck!
Winners: You can log into The Scripting Games Web site and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they’ve won a prize.
Yesterday at TechEd North America, Jeffrey Snover and Kenneth Hansen began describing features to be delivered with PowerShell v4 in Windows Server 2012 R2 (the company has not yet announced availability dates for either).
In particular, a new feature called Desired State Configuration promises to become the foundation for some pretty serious expansion. Essentially, DSC lets administrators write a declarative “script” that describes what a computer should look like. PowerShell takes that, matches the declarative components with underlying modules, and ensures that the computer does, in fact, look like that. Nearly anything can be checked and controlled: roles, features, files, registry keys - anything, in fact, that a PowerShell module can do.
The architecture includes the notion of centrally stored declarative scripts, and the ability to dynamically deploy supporting modules on an as-needed basis to computers that are checking themselves. A System Center Virtual Machine Manager demonstration utilized the feature to dynamically spin up brand-new VM instances and have them immediately reconfigure to their desired state.
At first glance, it’s easy to see “more Microsoft stuff” in this feature. After all, the company has previous given us Dynamic Systems Management (DSM), various universal “configuration languages,” and even System Center Configuration Manager’s somewhat primitive configuration auditing feature. But keep in mind that DSC will be a core part of the OS. That means product teams and ISVs can rely on it being there, with no other dependencies to worry about. DSC is also built around DMTF standards - like the MOF format - making it natively suitable for cross-platform management. A demo from Opscode using their Chef product showed clever use of the new DSC feature.
Hansen also mentioned that PowerShell modules will be deployable through DSC as ZIP files, helping make them more self-contained (not entirely unlike PECL packages in the Unix world).
There has been no announcement as yet on how far back PowerShell v4 will be made available, nor whether or not DSC is a PowerShell feature or a Windows Server 2012 R2 feature. If it is indeed a PowerShell feature (which I suspect it is), then it’ll be available on any system with v4 installed. That will hopefully include at least Windows 7, Windows Server 2008 R2, and later.
With week 5 in the books, I can see that everyone just continues to grow and show some great submissions. Of course, nothing is perfect and can always show areas of improvement, but trust me, you are all doing an excellent job!
I was hoping to have this article completed prior to now, but between a flight to Tech Ed and forgetting my power cord for the laptop, I am just now getting this accomplished. Better late than never :).
With that, head over to my blog to check out my notes on Event 5 here.
We’ve still got, oh, about 48 hours or so for Event 6 submissions, and then of course voting and judging. But I wanted to take a second and let you know what this year’s Games looked like:
We’ve logged over 1,100 entries. Almost 13,000 votes. More than 6,700 comments. That’s a lot - and it’ll all be archived once the final votes are tallied and prizes awarded. There will be ZIP files of entries for each track and event, and I encourage you to download them over the Summer - we won’t necessarily archive them permanently.
We’ve seen an enormous range of techniques and approaches, and generated hundreds of learning notes across more than a dozen active expert commentators. We’ve awarded - with some yet to be handed out - thousands of dollars worth of prizes.
This is also a good time to start collecting general feedback on the Games, so feel free to drop into our official post-mortem thread and offer your feedback. Read the introductory post in that thread before you post, please. I’m asking for a specific feedback format at this time, although you’re always welcome to open your own thread if you have something specific or off-format you want to offer. I ask only that you keep things constructive and professional.
Thanks to everyone who participated in the Games. We’re formulating our next event, so stay tuned.
I can honestly say that the interactions that I"™ve had with the PowerShell community over the past five years have been some of the most fulfilling. There is something to watching someone learn to script. Some plateau artificially mainly because they don"™t want to leave the GUI. Often they"™re forced into learning PowerShell and stubbornly go into trying to learn as little as possible. If you competed this year you do not fall into that category. You fall into the category that I love working with Talented Specialist that we watch graduate from good to great. I"™m happy to invite this year"™s class into “the club”.
For everyone else I have an invitation. If you would like to know what makes a good script great and will be in New Orleans next week for TechEd 2012 NA, then please join the judges of the Scripting Games as we do a public Code review. Simply put we"™ll take a script and as a group discuss what makes it good and bad. We"™re calling it best practices for the real word, but you"™ll see it listed in the directory under BOF-ITP23.
I loved this week"™s challenge as it had the right wiggle room to bring out the best in our participants. Of course, this is also the point in the games when we start to get everyone"™s “A” game. At this point even our new competitors are all warmed up and in the zone, and let me tell you the entries this week show it! I want to start with the beginners as I actually ran almost every entry this week. Honestly everyone fell into one of three buckets Select-string, Import-CSV or ,Foreach. Let me explain there where three primary means to solve this problem. Use Select-String and some basic text parsing to get the ip addresses, and then using Select-Object to filter. Converting the logs to objects with Import-CSV and using Where-Object to filter. Or using Foreach and a combination of if and where.
They are all three correct, so how does one judge one from another? As this is a competition I used speed as the determining gauge. For a long time I was convinced that the following was about perfect. Quick simple and accurate.
At the last TechMentor (in Orlando), I did a Windows PowerShell pre-conference workshop. The conference was kind enough to let me record it - I basically just used Camtasia, so this isn’t a professional video by any stretch, but it gives you an idea of what a TechMentor conference is like. Obviously, my focus was on the folks in the room, but you can see all of the demos and hear me pretty clearly. You can view the video for free, although note that registration is required.
Into the home stretch and the entries just keep getting better! The only advice I’d like to offer this time is to be careful to read the instructions carefully. They included the specific folder where the files were located and I noticed several misinterpretations in the scripts. Some included a mandatory Path parameter and others had a default Path that was not the specified folder. Including an optional Path with the correct default would certainly be acceptable, but not those variations.
The instructions also included some ambiguity about what the log file actually contains. Was the client IP address in the first column (as specified in the instructions) or in a different column (as presented in the example logs)? There were a number of entries that just searched the logs for IP addresses and returned all of them. This approach would not be able to distinguished between the client and server addresses, which would give a wrong answer. Another approach searched for the “c-ip” column, but this would only work if the log files were as in the samples. Another method, select the second IP address in a line would also only work on the sample log style. There weren’t many entries that supported both file types, but one of them did it in a very concise manner, checking the first and ninth columns for an IP address and selecting the correct one.
Most of the entries used Sort-Object -Unique or Select-Object -Unique to eliminate duplicates, which was the first approach that I thought of. There were several entries, however, that used alternate methods that I thought were quite clever applications of PowerShell technology: hash tables with the IP address as the key, and Group-Object on the IP address. Both options provided a fairly simple way to also report the instance count for each address.
Returning an instance count sounds like an interesting option, but after thinking about it some more, I’m not so sure. Counts of the number of sessions and the hits per session would be much more interesting than the raw hits count. But that’s way, way beyond the scope of this event.
Anyway, just one more event to go. I’m expecting a spectacular finish!
So what’s with the “super secret” PowerShell session being given by Jeffrey Snover at TechEd 2013?
First, if you’ll be in New Orleans, plan to attend this. The deal is pretty simple: Microsoft has got a lot of information pertaining to v.Next under embargo, which means people can’t talk about it yet, or even tell you the title of the session. But trust me, if you’re interested in the world of DevOps (and if you use PowerShell, you are), you’ll want to be at this session. PowerShell MVPs were given a sneak peek at what Snover will be discussing, and it’ll frankly blow your mind. It will, over the long haul, put PowerShell in a completely new place - and you’ll want to get in on the ground floor.
Like most sessions at TechEd, it appears as if they’ll be recording this, so even if you can’t attend in person be sure to check back once the recording is live. That usually takes a day or two after the talk itself.
And spread the word a bit. There’s a bit of a worry that, because even the title of the session won’t be announced until TechEd formally commences, folks won’t have much time to realize the session exists and it’ll go empty. We don’t want that to happen - as with any new developments in PowerShell, it’s crucial to get folks thinking about it early, to get their feedback early, and to start planning for it early.