Learn about Windows PowerShell
Beginner Event 8: The pole vault
In the pole vault event, you will raise the bar as you run down the folder that is consuming the most disk space on your computer.
“Hey, Scripting Guy! How can I leap over buildings with a single bound?” No, we have not received an e-mail such as that yet. But if we ever do, we will point them to the pole vault event. An old dude once said, "Give me a lever long enough and I will move the moon." Of course, that was back when lever technology was still new, and its inventors were still trying to find out the practical limits of that new and exciting technology. Well, a pole vault is the sports application of lever technology. Scripting is the IT pro’s lever. We could just as well say, “Give me the right script and we will move the moon.” All we need to do is to find the WIN32_Moon WMI class and implement the move method, and we are good to go.
In this event, you are tasked with solving a very common problem. Sherlock Holmes might call it The Case of the Missing Disk Space. You get to play Dr. Watson and write a script that will query your local hard drive in an attempt to identify which folder is consuming the most disk space. You will need a strong lever when you try to vault over this assignment. Keep in mind that folders can contain other folders, which in turn can contain other folders. You get the idea.
Hint: If you are stumped with this task, you may want to search the Script Center for information about recursion. If you write a script that uses recursion, the script will be much easier to develop.
Advanced Event 8: The pole vault
In the pole vault event, you will soar over your goals as you write an activity tracker script.
All the Scripting Games links in one location! Let the learning begin. (We will update this page every