Wednesday, October 22, 2014

In a recent blog post, I noted the arrival of PowerShell V5 preview within the technical preview of Windows 10. A slightly later version than is available for installation on down-level operating systems ( I use the latest V5 preview version both on my Windows 8.1 laptop and my main home workstation (which runs Server 2012 R2). While Desired State Configuration is the ‘big’ new feature in V5, there are a lot of other cool features in V5, including the ability to manage zip files with PowerShell.

The later V5 preview versions come with two new cmdlets or managing ZIP files:

Compress-Archive

Expand-Archive

The Compress-Archive cmdlet takes an array of file names (specified via the –Path parameter) and compresses them into an archive file (specified by the -DestinationPath Parameter). You can also specify the level of compression – the valid values are NoCompression, Optimal, Fastest. Fastest means that the compression is less than Optimal, but Optimal should produce slightly smaller .ZIP files. Optimal, however, takes more CPU time – but there’s not much difference for smaller files. To have Compress-Archive update some or all the files in the archive, use the –Update parameter. This parameter updates the archive with the specified files. Thus you can update a single file in an archive should the need arise.

The Expand-Archive cmdlet expands the files in the archive (specified by the –Path parameter) into the folder specified by the –DestinationPath parameter. To avoid being asked for permission to do the expansion, you can speciy the –Force parameter.

Monday, October 20, 2014

Last weekend, I held another PowerShell PowerCamp event – we had 19 attendees in all for two days of PowerShell. It was a great weekend, topped off by Tom Arbuthnot coming in on the Sunday to deliver a guest lecture. I really enjoyed it, but it was a lot of work! And from the mail I've had, the attendees got a lot out of it.

Thanks to the folks at Microsoft, particularly Claire Smyth, for all their help in making the weekend a success.

During the event, there were several ideas put forward to a next event. One suggestion was a more advanced weekend, particularly looking at DSC and the new things in Version 5. A V5 PowerCamp could be fun! Ideas as to future events are most welcome.

Like a lot of people, I’ve downloaded and been playing with the previews of Windows 10 (client and server). About the first thing I did was to check out PowerShell and was delighted to find it contains a very late drop of the PowerShell V5 code – marginally later than the WMF Preview shipped in September.

My Server 2012R2 workstation, which has the September V5 drop reports:

Meanwhile, in the Windows 10 Server preview, we see:

As you can see, Windows 10 has a slightly newer version of PowerShell V5. The release notes don’t clarify what has changed, but I’d have expected the 9841 to be just a bug fixed fork of 9814.

This new version of PowerShell brings some big changes, not least of which is the improvements and enhancements to Desired State Configuration – no doubt this will feature large in the eventual launch of Windows 10 Server (Server 2015??).

But there are also a bunch of smaller changes that I also am very keen to see go mainstream. These include:

Archive (.ZIP file) cmdlets

Changes to –item noun to enable symbolic links

The ability to develop classes (and enums) using PowerShell

Improvements in DSC authoring within the ISE

PowerShell transcripts within the ISE

Better script tracing

PowerShell V5 looks like being a block buster! I’ll be writing blog articles about each of these new features along with some usage of them for your delight!