CTP: Versioning

Next week we’ll be releasing a Community Technology Preview (CTP) of Windows PowerShell V2.0. I’m going to hold off saying what is in it until next week. The purpose of this email is to set your expectations about the CTP.

Versioning

  • The PowerShell CTP REPLACES PowerShell V1.0. They do not run side-by-side.
    • To install the PowerShell CTP, you must first turn off and uninstall any previous version of Windows PowerShell. (Instructions for how to do this will be in the release notes).
    • This is because of StrongName Binding. If we did side-by-side, no V1 cmdlets would work because they bind against the V1 PowerShell.
    • In this regard, we are pursuing exactly the same approach as .NET itself. ORCAS is a replacement for .NET 2.0/3.0 not a side-by-side install. This means that we have to be super super careful about compatibility but that everything continues to work.
  • PowerShell CTP is compatible with PowerShell V1.0. Your V1.0 cmdlet, providers and scripts should work without modification on the CTP.
    • We try to be super careful about compatibility.
      We regularly run > 1 million tests, add to that suite constantly, and constantly self-host. That doesn’t mean that we are fully compatible but it does mean that at least a million things are compatible. In the past we’ve been able to make very substantial changes and (after we ensured that the tests all ran fine) everything as worked.
    • V1 compatibility is very important to us so if you encounter any regressions – please let us know ASAP. Clearly there will be some breaking changes – as we add new operators, keywords and cmdlets we are grabbing parts of the namespace that other people might use. We are just going to accept that pain as the price of progress. There are other changes that we are considering that would change existing behavior that we are fairly sure no one is using (because it doesn’t make any sense) and it would have to change to make V2 sensible. We haven’t made any of these yet but as we do, we’ll get your opinions on the changes
  • PowerShell Scripts continue to use “.PS1”.
    • We will continue to pursue this approach until there is a major change in the CLR or .NET frameworks which force us to go side-by-side. It is at that point that we’ll go from .PS1 to .PS2 . Until then we will stay with .PS1 and everything that runs today will continue to run in new releases.
    • You might write a .PS1 script which takes advantage of a cmdlet/feature that is only available in V2. If you send this to someone that has PS V1, it will fail “in some way and at some time”. If it uses some new syntax, it will fail at parse time (with a PARSER error) but if it uses a new command line switch – it won’t fail until it tries to run that command. This is what #REQUIRES is all about. You start your script with
      #REQUIRES -Version 2
      And we will check version #’s and produce a precise error message
    • If you have a #REQUIRES –VERSION 1 in your script, it will continue to run just find on PowerShell (V2) CTP because it is compatible with V1.

 

Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx