Learn about Windows PowerShell
Summary: Advanced Event 1 of the 2012 Scripting Games asks you to review a coworker’s script.
About this event
Date of Event
4/2/2012 12:01 AM
4/9/2012 12:01 AM
You work as a network administrator for a large company. You are part of a team of other network administrators that monitor several mission critical applications. Your coworker has convinced your boss that he knows everything about Windows PowerShell. As a result, whenever any scripting needs to be done, he always gets the nod. Recently, however, your boss has begun to have some doubts, and the boss has asked you to do a code review of the script that is shown here:
$notepad = Get-Process notepad
for ($i = 1 ; $i -le 10 ; $i++)
When you run the script, you receive the output that is shown here:
2012 Scripting Games: All Links on One Page
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. Good luck as you compete in this year’s Scripting Games. We wish you well.
Ed Wilson, Microsoft Scripting Guy
the games have begun! WOW!!!!
And this short first advanced event already might knock me out ... :-)
I'm reading through this event over and over again and I really have no clue how to solve it having no knowledge of the concrete job definition behind it!
Could you clarify the task, the boss has been asking for, please!?
Klaus. I had some problems figuring this one out myself, but got it in the end. There information needed is there ;) Good luck!
You're probably trying to read too much into it Klaus, I did the same with Beginner Event 1, spent a while trying to do too much and then decided it didn't have to be as complicated as I'd first thought.
@Øyvind @Bob: Thaks for replying to my problem!
Maybe ... it really should be sufficient to take it easy and write the answer down ...
But depending on the concrete task description, my answer could vary :-)
Anyway: Good luck to everybody!
Are we talking about a true minimum number of changes, or the minimum number of changes to ensure the script is following PowerShell best practices for writing a script?
Good question Alex. I was wondering the same thing actually.
@Alex: that's one reason, why I'm stuck and I have been asking similar questions.
And if the notepad is not running? I have to display a message?
Hi Fábio Jr,
You should make the minimum amount of changes to the script.
I got caught overthinking this one as well but cracked it now :D
@Martijn @Fábio Jr: Well martijn, this is part of our event description ... yes!
But "minimum amount of changes" to achieve .... what?
Even though I can easily see that the script to review is not working the way, I would expect it to work ... the question from Fábio Jr is something I would seriously consider to be a potential part of a minimum change ( again: to achieve "what"? )
How do I submit my Scripting Games 2012 entries? I've tried to go to the Scripting Games 2012 page but get an Access Denied error? What's happening? Also can I submit in both Beginner and Advanced?
@Neptune443: You should read the article
I'm afraid you have to choose only one category ... beginner vs. advanced
K_Schulte, no worries. It was the link above to "All Links on One Page" which was broken, at least for me. :)