Learn about Windows PowerShell
Summary: In Beginner Event 10, you are required to collect performance counter information about your CPU.
About this event
Date of Event
4/13/2012 12:01 AM
4/20/2012 12:01 AM
You are a network administrator for a small company, and you are attempting to monitor a transient problem with CPU spiking on one of your servers. You decide that rather than running the performance monitor or task manager, you want to use Windows PowerShell to collect the performance counter information. You do not have time to manually choose a bunch of counters, but you want to gather all of the counter information from the processor counter set. You should take three separate readings at five-second intervals. All of the counter information should be appended to a single text file that is named after the server and placed in the Documents special folder. An appropriate output is shown in the image that follows.
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 firstname.lastname@example.org, 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
Sorry, a bit confused again... Got my script finished but just want to get something clarified before uploading the script...
What is meant with "You should take three separate readings at five-second intervals"?
The interval I understand, but what about the seperate readings? For example, at 16:00:00 reading one, at 16:00:05 reading two and at 16:00:10 reading three?
The Documents "special" folder is not the easiest thing for me to figure out.
I’m judging my progress in the PS games by how much I’ve learnt and this event has taught me a lot I didn't know about collecting performance counter information with Powershell.
@Jeff Wouters I understand the same , you can take three samples "readings" at five-second intervals (not more than three).
@JSoCalDavis I think that we can create a special folder to store the "servername_ProcessorCounters.txt"
@John Grenfell In this post before the comments you can see the Tags, click the "performance" tag and you can learn a lot of things about "work with performance counters"
@aalaminos - That would be sweet if that's what they mean... but I'm not so sure since they say "the Documents special folder". If they said "a special folder under Documents", then I would be confident with your thought. I have been searching for hours on this one... has me stumped so far.
@SoCalDavis & @aalaminos: I think they mean this kind of special folder: en.wikipedia.org/.../Special_folder
Actually, I am going with my first thought regarding the "special" folder (and what someone else thought).
HOLY CRAP! I'd have to say that, for me at least, writing to the Documents special folder has been the most difficult challenge of the games. I don't do much file output from PS so this was pretty new to me. I think I'm going to start using it a lot more now. :) I <3 Scripting Games
Can we assume that the script will be run locally on the problem server, or should we be able to run the script again a remote computer?
@Jeff Wouters yes, you have it right.
@SoCalDavis - that is why I included it. It is useful to use, and not too difficult once you know the "secret"
@SteveH yes, run it local on the computer.
Definitely learned a good bit of helpful tidbits after doing this event! Truly addicted to powershell!!
Ack, submitted my script to the advanced event #10 instead - and now I can't upload it to the beginner event.
@Mark P we can change it to Beginner.
Thanks! The games have been a blast this year!