Learn about Windows PowerShell
Summary: In Beginner Event 6, you are required to compute the uptime for the local computer.
About this event
Date of Event
4/9/2012 12:01 AM
4/16/2012 12:01 AM
You are the main network administrator for a small company. As such, your duties consist of a variety of functions, including assisting the Help Desk when they get behind. Recently, your manager has become concerned about server uptime. He wants you to write a script that will display how long a server has been “up.” He said that he is not concerned with anything fancy—he just wants a general idea. The only real guidance he provided for the task is, “Use WMI. There is a class called Win32_OperatingSystem that should do the trick for you. Tell me the server name, and how many days, hours, and minutes the server has been up.”
The output that is shown in the image that follows meets the boss’s requirements.
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
@Eleftheria Th time since last reboot.
Last year I got dinged a star for simplicity for using the correct tense of the noun/verb combination when the number associated with it was 1, ie, "there is 1 minute" rather than "there are one minutes". I didn't see any simplicity requirements on this one but I don't want to let Mrs. Rabe down. Those rulers hurt!