Thursday, November 13, 2008

First impression of conference

The Devconnections conference seems to be really well organized. It is also quite a bit larger than I thought it would be. I took one of the preconference sessions for PowerShell scripting. It was actually a two full-day classes with a lot of hands on labs. I use VBScript for a lot of administrative tasks but all of my experience is self taught – I really didn’t want to redo all of that plain for PowerShell. The instructor was Don Jones, a Microsoft MVP and author of several books, and he was a really good teacher.

The class used a Windows 2008 Active Directory domain controller in a virtual machine for the PowerShell lessons. One oddity with the current version of PowerShell is that there are no commandlets from Microsoft for manipulating Active Directory. However, Quest Software has developed a set that they distribute for free that are pretty good. They were also smart enough to use names at are unlikely to conflict with the versions that Microsoft are bound to release eventually.

One of the best things that I learned about PowerShell is that you can call any existing command line command, program, or other executable from inside PowerShell. You can use PowerShell to grab a whole bunch of information, shove that into PowerShell variables, and then pass those variables as arguments to other programs. That should make it a lot more flexible then I originally thought.

PowerShell is almost too flexible, however. Since you can do almost anything, you have a hard time getting it to do what you actually want it to do.

2 comments:

Anonymous said...

Hi Matthew,

I'm curious about your last comment, that since PowerShell is so flexible you have a hard time getting it to do what you actually want. Can you be more specific about what motivated you to say that with examples?

PowerShell is flexible, sure, but I don't think it is so flexible that it makes it difficult. In fact, PowerShell is actually very consistent and in my opinion that consistency makes it easier to get it to do what I want it to do. Not to mention how short a PowerShell script is when compared to a VB script (or other language script). You're doing much more with much less, and have less margin for error as a result.

Since you come from a VBScript background, I encourage you to take a look at PowerGUI (http://powergui.org). It comes with a free PowerShell script editor that includes VBScript snippets to help VB scripters like yourself make the transition to PowerShell that much easier. Just open the script editor, press Ctrl+B (or select the Insert VBScript Snippet button from the toolbar), and voilĂ , a long list of VBScript functions will appear. If you select one you'll get the PowerShell equivalent inserted into your script, and you can go from there!

--
Kirk Munro [MVP]
Poshoholic
http://poshoholic.com

Anonymous said...

Hi Matthew,

Thanks for the post. Quest Software makes the AD comandlets and a full featured console+editor - PowerGUI available for free. We have built PowerGUI to help both people that want to learn PowerShell as well as for experts writing advanced scripts. I invite you to have a look http://powergui.org. In addition to the products, we also have an active user community that answers questions - so feel free to stop by and check us out.