What to Expect During the Scripting Games

What to Expect During the Scripting Games

  • Comments 10
  • Likes

Summary: The Scripting Wife discusses what she has learned in the last several Scripting Games.

Well, it is hard to believe that I could be considered a veteran of the Scripting Games. But I guess I am because this is my third Scripting Games. So for those of you who are competing in your first Scripting Games, what should you expect? Let me tell you.

1. You should expect to learn a lot about Windows PowerShell. Some of the events are tricky, and some are deceptively simple. This means you really need to know what is going on before you submit your entry.

2. Pay attention to the online Help, and also to the Hey, Scripting Guy! Blog posts. It seems that every year, at least one event is really similar to an example in the Help or to an blog that Ed has written.

3. Do not worry about your score. You want to know something? In the first leader board from last year, the person who actually won was way way down in the ranking. As a matter of a fact, I was in the top 10 on that first leaderboard. I eventually finished in the middle of the pack. Keep in mind there are only so many judges and all of these judges have other jobs. So they can only grade at night, and some only during the weekend. All scripts have until April 15 of this year to be graded. So your score and rank will change every day. In fact, on Sunday April 22 when all the judges will be trying to finish grading, the ranking will change on an hour-by-hour basis. Last year, several people actually wrote Windows PowerShell scripts that you could run and get an immediate update for the rankings. It was REALLY fun and exciting. Here is one script I found in the Scripting Guys Script Repository, but I know there are others as well.

4. When the scripts become public (seven days after the event goes live), you should take some time to see what other people submitted, see their grades, and read the comments by the judges. This is a great learning experience. It is not often that you get to see comments about scripts by people like Don Jones (not to mention all the other judges). In fact, I really like looking over other peoples scripts and seeing if I can understand what they did. I then try to guess what the judge might have said before I look at the comments.

5. Do not be in too big of a hurry to submit your answer. You might want to write your answer, and then come back and look at it the next day (just do not forget to submit it). I remember seeing at least one tweet last year where someone waited until the last minute (literally) and they messed up and did not get it submitted in time. Please don’t wait until the absolute last minute, but you might want to take a little time and think about your answer.

6. Read the question really closely. I know the Scripting Guy, and sometimes he is tricky. He loves to write an event that looks really hard, but has a very simple answer (although sometimes he goes the other way and writes something that seems really simple until you think about it). Honestly, it is part of scripting. You need to understand the requirements. What I do is make a list on a piece of paper and in one column I list every requirement that I can find in the event. In the other column, I list everything that I can find about a clue. So I end up with a table that lists requirements and assets. It works for me.

7. If you do not understand an event, feel free to post a comment on the blog. I know for a fact that Ed is spending a lot of time reviewing comments and trying to answer them.

8. You might want to follow @ScriptingWife and @ScriptingGuys on Twitter. Create a filter for #2012SG because all the 2012 Scripting Games tweets are adding that hash tag so it makes sense to filter for that.

Well that is it. I am heading out now...for real. Take care, and good luck. Don’t forget that if you are in the area near Charlotte, NC, the Charlotte PowerShell Users Group meeting is Thursday, April 5th and it will be a Script Club event.

Sincerely,

Scripting Wife

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • #updated leader board that works for #2012GB

    <#

       .SYNOPSIS

           Pulls down the leaderboards for the 2012 Scripting Games

       .DESCRIPTION

           Quick and dirty script to pull down the leaderboards for the 2012 scripting games.  

           Can choose either beginner or advanced via a command line switch. To see the output

           in a table, you must pipe to "format-table -autosize" or "out-gridview"

       .PARAMETER  Level

           The leaderboard to parse

       .EXAMPLE

           Get-LeaderBoard -Level Beginner

           Retrieves the beginner leaderboard.

       .EXAMPLE

           Get-LeaderBoard -Level Advanced

           Retrieves the advanced leaderboard

       .EXAMPLE

           Get-LeaderBoard Advanced | Format-Table -Autosize

           Retrieves the advanced leaderboard and returns values in a table

       .EXAMPLE

           Get-LeaderBoard Advanced | Format-Table -Autosize

           Retrieves the advanced leaderboard and displays a table.

       .EXAMPLE

           Get-LeaderBoard Advanced | where { $_.UserName -eq "My Name" }

           Retrieves status for user "My Name"    

       .NOTES

           NAME:      Get-LeaderBoard

            VERSION:   1.01

            AUTHOR:    Alex McFarland

            LASTEDIT:  04/23/2012

            -Added rankings to output.  This unfortunately requires use of ft - auto to get  

            decent looking output.

           -Incorporated regex changes to to issues points out by Scott Alvarino. Was

            missing foreign language characters and periods.

    #>

    function Get-LeaderBoard  

    {

       param(

           [Parameter(

               Position = 0,

               Mandatory = $true,

               HelpMessage = "Leaderboard to parse.  Advanced, or Beginner")]

           [ValidateSet("Advanced","Beginner")]

           [String]$Level="Advanced"

       )

       # create a webclient

       $WebClient = New-Object System.Net.WebClient

       # download the page

       $LeaderPage = $WebClient.DownloadString("2012sg.poshcode.org/.../TopUsers$Level")  

       # create a horrific looking regular expression

       $RegEx = '<a href="/Scripts/By/\d{1,3}">(?<UserName>[\w\s\S]*)</a>\s*</td>\s*<td>\s*(?<TotalPoints>\d{1,2}\.\d{1,2})\s*</td>\s*<td>\s*(?<ScriptsRated>\d*)'

       # initialize counter for ratings

       $i = 1

       # split the page into seperate objects so we can parse each invidual

       $LeaderPage -split "<tr>" | ForEach {  

           # match the regex

           $_ -match $RegEx | Out-Null

           # create a new PSObject, supply a hashtable with the properties

           if (-not $Matches.UserName -eq "")  

           {

               New-Object PSObject -Property @{

                   "Ranking" = $i++

                   "UserName" = $Matches.UserName

                   "ScriptsRated" = $Matches.ScriptsRated

                   "TotalPoints" = $Matches.TotalPoints

                   "AverageRating" = if  ($Matches.ScriptsRated -gt 0)  

                   {

                       # get average round to two decimal places

                       "{0:N2}" -f ($Matches.TotalPoints / $Matches.ScriptsRated)

                   }

               }

           }

           # clear matches

           if ($Matches) { $Matches.Clear() }

           # get our objects in a specific order.

       } | select -Unique Ranking,UserName,ScriptsRated,AverageRating,TotalPoints

    }

  • @Vern_Anderson - posting that as a coment won't work..YOu strings will be obfusctaed if they look like URLs.

    Post it in the script repossitory and then post the link here.

  • @Vern_Anderson - posting that script as a comment won't work..Your strings will be obfuscated if they look like URLs.

    Post it in the script repository and then post the link here.

    (sorry about the spelling)

  • Hey Vern_Anderson,

    "Quick and dirty script..."? O_o

    Teresa,

    Thanks for the post/information!

  • What time zone is the Scripting Games running in for deadlines etc.?

  • FWIW, I'm planning on updating that script for 2012.  The only required change is to update the URL (2012 vs 2011), but I also want to fix the formatting by using custom types, as I hate the fact that you need to pipe it to ft -auto to get the table view.

  • @Ken Hamilton The time zone is Redmond time, which is (-8) GMT.

  • @Alex McFarland I really appreciate you taking the time to write the Get-Leadboard script. It is awesome. Also I agree with @JRV that you should upload it to the Scripting Guys Script Repository, and then make the link available.

  • Hi, thanks for your comment. I’m glad you find this collection useful.

    Thanks

  • Hello,

    Thank you for your nice information.I like it.