2012 Scripting Games Beginner Event 10: Collect Performance Counter Information
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.
- You can write the performance counter information directly to a text file named after the server. Place the text file into the Documents special folder. The file name will look like the following: servername_ProcessorCounters.txt.
- Your command should retrieve all of the performance counter information from the Processor performance counter set.
- You do not need to write a long convoluted script to meet the requirements of this scenario. You will lose points for long, complicated, hard-to-read scripts.
- A “one liner” command can be written that will satisfy the requirements of this scenario.
- You should use native Windows PowerShell commands for this scenario where possible.
2012 Scripting Games links
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