Introduction to Transactions

The information in this article was written against the second Community Technology Preview (CTP2) of Windows PowerShell 2.0. This information is subject to change in future releases of Windows PowerShell 2.0.

An Introduction to Windows PowerShell 2.0 CTP v2

As many of you know by now, there’s a new Community Technology Preview (CTP) release of Windows PowerShell 2.0 available for downloading. The Scripting Guys have had an (admittedly limited) chance to play around with the software, and it seems to work as advertised. At the very least we’ve yet to run into any major problems. In fact, now that we think about it, we haven’t run into any minor problems, either. It’s a beta release, but it’s a beta release that seems pretty stable.

So does that mean you should immediately delete your old version of Windows PowerShell and install the new CTP release? Well, maybe. There are definitely some cool new things in the CTP release, including:

  • A much improved version of Graphical Windows PowerShell. Graphical Windows PowerShell is now not only a viable script editor, but it might actually be a better environment for running your PowerShell commands. (Not only does it separate the commands from the output, but you can even use Ctrl+C and Ctrl+V to perform cut-and-paste operations.)

  • Support (albeit limited) for PowerShell transactions.

  • A new eventing infrastructure, including built-in support for WMI events.

  • New cmdlets that do everything from generate random numbers to save your PowerShell output as an XML file.

That’s the good news. The bad news – at least for the moment – is that the PowerShell team has changed the way the product handles remoting. In the original CTP release, remoting worked on any computer capable of running Windows Remote Management. That’s not the case with CTP release 2: in this release, remoting works only on Windows Vista (with Service Pack 1 installed) and Windows Server 2008. We’ll repeat that: remoting works only on Windows Vista Service Pack 1, and on Windows Server 2008.

Oh, and even then you’ll need to install WinRM 2.0 to get remoting to work.

Oh, and note that you can only connect to another computer running Windows Vista or Windows Server 2008. What if you install the new CTP release on your Windows Vista machine and then try to remotely run a command on a computer running Windows XP? Sorry; that’s not going to work. As Jeffrey Snover noted in the PowerShell team blog, “ … remoting is only going to work FROM and TO Vista and WS08 boxes …. All I can say is 1) we know exactly how BIG of a deal this is 2) we worked like heck to try and make it happen 3) the facts we were faced did not allow it to happen.”

That’s neither good nor bad; it’s just something you should be aware of. As far as we know the new CTP release runs just fine under Windows XP (not that anyone still uses Windows XP, mind you). You just won’t be able to use remoting.

And yes, that will likely change before PowerShell 2.0 is officially released. As Jeffrey added, “… we are working very hard to make it [remoting] available on downlevel machines in subsequent public releases.” But remember, with Windows PowerShell, as with life itself, there are no guarantees.

Note, too that very few of the new cmdlets and new capabilities have been documented yet. (Fortunately, the new remoting features have been extensively documented. Type Get-Help about-remote\* for a list of topics. And be sure you read the documentation for the new cmdlet Invoke-Command.) As we noted, the Scripting Guys have had only a limited amount of time to play with the new CTP release, which means that we don’t know too much about how it works, either. We’ll continue to investigate the new capabilities, however, and any time we find something new/useful/interesting we’ll be sure and post it on the CTP home page.

In the meantime, if you have a spare computer lying around, well, you could do worse than install the new CTP and start playing around with it yourself.

Note. How much worse? We don’t know; that’s just a figure of speech. But you can take our word for this: there are some cool new features in the latest CTP, and PowerShell is becoming more and more viable as a system management tool. It’s definitely worth a look.