It’s been a busy summer and I’m just getting around to installing the PowerShell v5 Preview. And it’s a good one. It’s officially called the “Windows Management Framework 5.0 Preview September 2014” but it’s all PowerShell. It will install on Windows Server 2012 R2 and Windows 8.1, both 32 and 64 bit varieties. This is a Preview, a beta, so don’t install it on a Production machine. Don’t test in Production. But if you have a test machine, go ahead and install this and take it for a spin. You’ll be glad you did.
There are a ton of great new features in PowerShell v5. Several blog posts worth. Too many for me to list here, though they are all listed in the 59 page Word doc that comes with the download. I will, however, tease you with two of my favorites.
Transcript works in the Integrated Scripting Environment (ISE) Huzzah!
This has been my main disappointment in PowerShell for a couple of versions. I teach PowerShell classes and write blog posts on PowerShell, and am generally a PowerShell doodler. The Transcript is invaluable in all of those situations. And while the first generation of the ISE was nothing to write home about, it’s gotten pretty impressive lately. I’ve wanted to take advantage of it, but it didn’t work with the Transcript. <sad panda> In the past I’ve had to choose between my old, faithful functionality, the Transcript, and the new hotness, the ISE. Conflicts aplenty. Well, no more.
The ISE now supports the Transcript. No more choosing. I get my cake and I get to eat it!
Now I have no more excuses, the ISE will be my PowerShell interface of choice.
PowerShell natively zips and unzips files
This is another one of those, “What do you mean PowerShell doesn’t…” situations I keep having with PowerShell. It seemed amazing to me that there wasn’t easy native support for zipping and unzipping files in PowerShell. I’ve spent hours looking for it. Now in v5 it’s finally here. Two new cmdlets, Compress-Archive and Expand-Archive handle the zipping and unzipping respectively. As of the writing of this article, there aren’t any –examples in the help documentation, but I expect after a few Update-Help executions some will show up. Here’s an example to get you started:
Compress-Archive power*.txt -DestinationPath .\gold.zip -CompressionLevel Optimal
Running that in the folder that has all your PowerShell Transcript files into a single file, gold.zip. To keep it updated, run the same command with the optional –Update parameter.
There you go, two excellent reasons to install the PowerShell v5 Preview on your favorite test box.