Recent Articles

PowerShell PS1 - I Feel the Power But You're Ugly!

PowerShell, the next generation of Windows command line tool, was previously known as Microsoft Shell (code-named Monad). I was intrigue and started playing with the scripts when it came out. Of course, they were called MSH scripts back then and every file carried the ".msh" extension.

Marketing Gone Overboard

The term "Microsoft Shell" was too plain and people wouldn't be able to discriminate with other shells popularized on Linux and Unix. So it was thought that by giving a stronger name would boost adoption and turn heads.

When the marketing people at Microsoft finally decided to rename Microsoft Shell to PowerShell, they also renamed the script file extension to ".ps1". Note, it's a numeric "1" character at the end of the extension and not the lowercase alphabet "L".

Why the Ugly PS1?

I was perplexed by the odd extension used, so I posted a message in protest to Microsoft while they were busy pushing out the Release Candidate. I was hoping they rename the extension to something more sensible like ".msh" or ".psh" before it goes live.

I complained for several reasons. By that time, there were already numerous scripts contributed by the community carrying the ".msh" extension. Renaming to ".ps1" would require refactoring all the script dependencies since command line files tend to be webbed together in use. At this time and even today, most powershell scripts as we know are written in Notepad so there is no quick facility to refactor names. Secondly, the odd numeric "1" could easily be confused with the letter "L" in some fonts and could lead to a potential security exploit.

Give Your Scripts a Version Number

It turns out the rename was not just a marketing ploy. It was for self-versioning purposes. Microsoft decided that scripts should automatically carry a version by virtue of its file extension. For example, the next major version will require scripts to be named with a ".ps2", ".ps3" extension and so forth.

I can imagine several benefits to have versioning. For one thing, it makes it easier to manage any backward incompatibilities between versions of the PowerShell. Scripts files are just text and don't have strong name or version information embedded unlike binary DLL or EXE so the file extension becomes a natural place to store that information.

Curiously, I've never seen this in other shells and I have yet to wait to see how this will play out in the field. So get ready, because you'll see a lot more numbered extensions coming along if this trend catches on.