The New Windows PowerShell, Part I

I’ve been looking at the new PowerShell from Microsoft. You can think of PowerShell as a replacement for (or possibly an addition to) the old CMD shell and .BAT files (which in turn were a replacement for the original Windows COMMAND shell and language). My bottom line opinion: it’s not an absolutely must-have-right-now technology but it’s pretty cool and I think it’ll make a nice addition to your personal skill-set if you work in a Windows environment. PowerShell (PS) was formerly code-named Monad. PS is a combination of a shell environment and a scripting language which can be used interactively or as an executable script file. The image at the bottom of this blog entry shows a demonstration interactive session. I use the set-location "cmdlet" to navigate to a folder and then search a file for the string "the". PS was originally was going be released with Windows Vista, but Vista’s ship schedule is so complex, apparently Microsoft has decided to make PS available before Vista. From my initial looks at it, I believe that PS will be used by developers, testers, and system administrators in cases where .BAT files just aren’t quite good enough (meaning awkward to write), but using a more powerful language like C# is a bit of overkill. For example, maybe you’ve written .BAT file scripts which have some significant branching or looping logic. You can do it using the GOTO command with labels, but that technique is a bit awkward. A particular task I’ve noticed that PowerShell seems to be especially useful for is manipulating WMI (Windows Management Instrumentation) objects to perform systems administration tasks.

This entry was posted in Software Test Automation. Bookmark the permalink.