Learn about Windows PowerShell
Good morning everyone … and yes I said morning. The Scripting Guy and I are up early this morning. He is busy packing, and so I thought I would hop into his office and give you my impression of beginner event 8. Why am I up so early you may ask? Well we are on our way to Vegas for the PowerShell Deep Dive. It will be a rather long flight for us – in the neighborhood of four hours, but that is ok because our seats are at opposite ends of the plane. He is in an exit row, and I am riding on the tail flaps I guess. He will not even miss me during the flight – what with his Zune, and his laptop he will spend most of the trip writing PowerShell scripts. Me? I will be reading a nice book (assuming the wind does not blow it out of my hands).
Anyway, allow yourself ample time to write the script for event 8. It is kind of strange that there is no cmdlet that will tell me information about disk drives … so I had to resort to using WMI. I know the Scripting Guy has written a lot about disk drives, but there is a lot of stuff to read through, and so I just went to MSDN and using Bing searched for disk drive space. I know that is not a great search, but I found information about WMI and disks on that page, so as I always say, “any search that returns what you need is a good search.” Once you have found the disk information, the rest is really easy. I used the Get-Command cmdlet to look for cmdlets that have a noun that is something like a CSV, so that I could pipeline my output to a CSV file. The really cool thing I have learned about CSV files is if you double click them they open in Microsoft Excel. Because I used to do Accounting, I LOVE Microsoft Excel!!! And the fact that there is a cmdlet that virtually creates Microsoft Excel spreadsheets … well at the risk of sounding too much like a geek (like the Scripting Guy) this is cool stuff. Hope you are having fun and learning a lot of useful information in the 2011 Scripting Games. Have a scriptastic day.
Strange. My interpretation of event 8 is that we have to generate a "dir" as a csv, so no need for WMI.
@Martin - That is the same interpretation I got. The task is to generate a listing of the files within a directory, not the drive space.
@Martin @Brian You are both right. I think she messed up on this one. Although, it is possible she got it right and just did way TOO much work. It IS possible to obtain this information from WMI ... So either she misread the requirements, or she took the long approach. I will ask her when she gets back in but who knows how her mind works. We are in Vegas now for the PowerShell Deep Dive, and she grabbed her purse and headed towards "the strip." Not sure what she is up to, but I will find out soon ... she got us tickets for the Phantom of the Opera for this evening, so she is bound to show back up before too long.
She didn't mess up, she just took the scenic route.
@cseiter Thanks you for seeing my side of the thought process. I like the scenic route.
The new game will feature new game-engine, changes in character development and better PVP system