Summary: Microsoft Scripting Guy, Ed Wilson, shares his top eight tricks for achieving stellar success in this year’s Windows PowerShell Scripting Games.
Microsoft Scripting Guy, Ed Wilson, is here. OK. Today I figure you are all busy working on catching up with the first five events of the 2012 Scripting Games. You are not, you say? Well then, it is not too late. You have until 11:59 PM tomorrow night (Pacific Time (-8 GMT)) to complete Event 1. While you are at it, go ahead and knock out Events 2 through 5. Completing all five events (at the beginner level) should not take you more than a few hours of concentrated, diligent work.
Top suggestions for success in the 2012 Scripting Games
If you have never competed in the Scripting Games, you are in for a treat. They are amazingly fun, but they can also be a real challenge. Here are some suggestions to help you succeed in this year’s games.
- Read the entire scenario. If a scenario states that you are running all Windows 2000 computers, it means you will be limited to using the Get-WmiObject cmdlet and running remote WMI commands. On the other hand, if the scenario states that all servers are running Windows Server 2008 R2, all workstations are running Windows 7, and Windows PowerShell remoting has been enabled on all systems, you will be able to use the full resources of Windows PowerShell 2.0 in your solution.
- Pay close attention to the Design points, but do not ignore the scenario. If the Design points say that you do not need to write a script—you can use a single Windows PowerShell command, then do not submit a 200-line script.
- Open Notepad and outline what you want to accomplish. Specify inputs to the script and desired outputs from the script. Write down the steps that you know how to accomplish, and make notes of things that will require you to perform research to answer. This file, when completed, serves as a great blueprint for your answer.
- Open the Windows PowerShell console and the Windows PowerShell ISE and begin writing the solution. Make sure that what you thought would work does in fact work. Next add comments for the portions that will need additional information and development.
- Pay close attention to the resources in the 2012 Scripting Games Study Guide. I know the Study Guide is considered a prep tool, but it is also a great resource for learning and for researching solutions to problems. After all, the Scripting Games, at its most basic level, is simply a collection of problems.
- Pay close attention to the resources that are provided by running Help cmdlet name -full | more. It is the extended Help that comes from using the –Full parameter that will often provide just the information you need to help you come up with an exceedingly elegant solution to a problem.
- Don’t feel bad about searching through previous Hey, Scripting Guy! Blogs in search of solutions to problems. Pay particular attention to the Scripting Wife blogs when it is time to solve basic problems. The Scripting Wife is a beginner; therefore, it is likely that she has faced similar situations to those that you might see.
- Don’t be shy when it comes to searching the Scripting Guys Script Repository. The Script Repository is a great place to find answers to common problems.
These suggestions also work for the real world
The above seven suggestions are listed in the context of the 2012 Scripting Games, but they also apply to any scripting problem that you may face at home or at work. In particular, it is important to understand the needs of the script, and how the script will work in your environment. I have found that writing down what I know and what I need to know is a great place to start when writing a custom solution. When it comes to searching for a piece of missing information that I need for a solution, I generally begin by searching the Hey, Scripting Guy! Blog. (Hey, I cannot remember everything I write). Next, I search MSDN. Finally, I will perform a search using Bing. Generally, my search takes the form of “PowerShell” plus whatever I need.
Last minute suggestions for the 2012 Scripting Games
Remember, the primary goal of the 2012 Scripting Games is for you to improve your skills with Windows PowerShell. If you are already an advanced scripter when it comes to Windows PowerShell, I hope you become even more advanced. If you cannot even spell Windows PowerShell, I hope you will become familiar with Windows PowerShell and learn the basics. To do this, you may want to watch the following five-part series:
After you watch the videos, take the Windows PowerShell quizzes. The 2012 PowerShell Scripting Games Quiz relates to the Windows PowerShell for the Busy Admin series. The Windows PowerShell Basics quiz relates to the Windows PowerShell: Learn It Now Before It’s an Emergency series.
Well, that is all for today. I am going to get back to grading the scripts that have been submitted, and you can use the extra time to work on your answers or watch the videos. Join me tomorrow when the 2012 Scripting Games returns with Event 6.
I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at email@example.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.
Ed Wilson, Microsoft Scripting Guy