Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's SharePoint Admin Blog > Posts > PowerShell v5 Preview is Out. Here are my two favorite features
September 07
PowerShell v5 Preview is Out. Here are my two favorite features

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!

image

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.

tk

ShortURL: http://www.toddklindt.com/PowerShellv5Preview

Comments

Generics and PowerShell

I like to use powershell for rapid prototyping because of its REPL (something which is missing in C#).

however I find it very annoying that powrshell does not provide any convenience means of writing code with Generics.

is powershell team doing anything about this?
 on 9/7/2014 10:51 PM

Try Scriptcs

As a response to the comment about REPL and C#. Take a look at ScriptCs

/Stefan
@sstranger
 on 9/8/2014 2:25 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 Please Support my Sponsors