Saturday, November 03, 2007

Windows PowerShell V2 CTP Shipping Soon

VERY COOL -- V2 PowerShell CTP is shipping to the web very shortly. There are some incredibly neat components of V2. Some are aimed at ISVs and more advanced users. There are also some darn useful other stuff that I really am enjoying too. I have it running here and it's very stable. I'll let Kenneth and the PowerShell team spill the details, but this is a very useful update. PowerShell V2 ROCKS!!

As an aside, this CTP represents the PowerShell team's efforts, a year after V1 was released. A lot of neat technology but some unfinished work too. Of course this is to be expected, but it means that this release comes with a warning clearly spelt out on the PowerShell team's blog: CTP != BETA !. I expect many things will change  between now and RTM (whenever that happens).

One interesting aspect of the CTP and PowerShell V2, it's a replacement for PowerShell V1, and not a side-by-side install. So far as I can tell, everything I can do in V1 (in terms of demos in classes, etc) works just with the CTP. Well so far!!   This also means that .ps1 files run with PowerShell Version 2. This could get confusing. Well it could have had the team not thought ahead. As Jeffrey Snover describes in a blog entry (Versioning), you can code around this. Just begin your scripts with a #Requires directive! For example:

#REQUIRES -Version 2
"In script that requires PowerShell Version 2"
If you run this on a system which does not have V2 yet (like most of you reading this now!) will get a message:
PSH [D:\foo]: .\v2.ps1
The script 'v2.ps1' cannot be run because it contained a "#requires" statement at line 1 for Windows PowerShell version
 2.0. This does not match the currently running PowerShell Version 1.0.
At line:1 char:9
+ .\v2.ps1 <<<<

Now that shows someone really thought ahead - a very nice touch. And I so much want to say a lot more about this release!

In closing, a CTP health warning as requested:

The PowerShell V2 CTP is not for everyone. You should read this PowerShell Team blog entry ( ) to find out what it is and what it isn't and then make an informed decision before installing the CTP. 

No comments: