Commentary: Microsoft's PowerShell is a solid step forward in script-language design. The power of the system comes from the background use of objects, as opposed to plain text.

Aesthetically, PowerShell doesn't look too different from most existing shell scripting clients. In fact, on a superficial level you could probably be fooled into thinking that it is exactly the same as either bash or cmd. PowerShell, however has a very powerful underlying structure that ties in neatly with the registry, the .NET Framework and (more obviously) the file system.

PowerShell is designed for the comfort of both Unix and Windows system operators. There are predefined aliases for all of the common commands that usually plague developers who bounce from one platform to another. A directory listing can be achieved by using either dir or ls and the result is identical. Similar aliasing is used for directory alterations and other common tasks. However, there is one fundamental difference. The text displayed on screen is a result of a collection of objects using their ToString functions, as opposed to a simple text dump.

Every command in PowerShell returns a collection of objects. These objects can be manipulated in the exact same way as if you were using an object-oriented language. The ls/dir command creates a collection of file objects which can have any .NET function performed upon them from within the shell. The default action being their ToString method (for display purposes), but there are no restrictions to what you can do with the collection.

PowerShell allows the output of the objects to be formatted in many common ways. If the user does not specify a format for the output, PowerShell automatically selects the one it thinks is the most suitable. Common commands can be written and stored on the fly and will last until the session is terminated. They can also be permanently written into the PowerShell's setup files.

As previously mentioned, PowerShell is not restricted to file system manipulation. There is native support for registry editing; if fact, the Registry is treated as if it was just another directory. As a result, a lot more can be accomplished by the one window without its behaviour being unpredictable or awkward.

PowerShell was originally slated for release with Vista, but its release has now been postponed and will be released online. A beta version is available here.

Related links

Comments

1

Chrisbob - 29/09/06

Sounds cool, sounds like it solves 50% of what makes me whinge when I work on the command line in Windows. But will it stop the other 50% of whinging:
Can I type
dir Doc<tab>
instead of
dir Documents and Settings

» Report offensive content

2

Nathan - 19/12/08

Uh, yeah... and you could've since XP. Make sure you're using "cmd" and not "command", though.

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

2

Nathan - 19/12/08

Uh, yeah... and you could've since XP. Make sure you're using "cmd" and not "command", though. ... more

1

Chrisbob - 29/09/06

Sounds cool, sounds like it solves 50% of what makes me whinge when I work on the command line in Windows. ... more

Log in


Sign up | Forgot your password?

  • Staff A first look at Windows 7 beta

    In this week's Roundup we show you a preview of Windows 7 beta, cover news from the annual Macworld and more. Read more »

    -- posted by Staff

  • Staff Opera's new SDK: Better browsing on the Wii?

    Opera has thrown a little more love at device developers by announcing an updated version of its software development kit on Wednesday at CES. Read more »

    -- posted by Staff

  • Staff 2008: Time to call stumps

    It's another year down but some things never change. That was shown this week as Internet Explorer remained under fire from yet another zero-day exploit. In other news, we set a hard drive on fire and Apple cans its involvement with MacWorld. Read more »

    -- posted by Staff

What's on?