Weekend Scripter: Team Talk About Why to Upgrade to PowerShell 4.0


Summary: Windows PowerShell program manager, John Slack, talks about upgrading to Windows PowerShell 4.0.

Microsoft Scripting Guy, Ed Wilson, is here. Today we have John Slack, a program manager in the Windows PowerShell team as our guest blogger...

Do you use the version of Windows PowerShell that ships with your operating system? Do you wonder if you should make the jump and install Windows PowerShell 4.0 or try out Windows PowerShell 5.0 Preview?

Here’s the short answer: I think you should.

Want more of an explanation? At a high level, I see the following benefits to updating:

  • New features make your life simpler.
  • You stay ahead of the curve by learning about new features.
  • Your feedback makes Windows PowerShell better.

New features make your life simpler

Each successive version of Windows PowerShell adds features and improves existing functionalities. These features are designed to help you get your job done faster and more effectively. Jumping from Windows PowerShell 2.0 to Windows PowerShell 4.0 can give you huge benefits. The list of improvements is significant, and it can’t really be condensed into a single blog post, but I’ll try to detail a few representative samples.

  • Desired State Configuration (DSC)
    If you need to configure machines running Windows in a DevOps friendly way, DSC (introduced in Windows PowerShell 4.0) is a significant step up from complicated and fragile configuration scripts. For more information, see about_DesiredStateConfiguration.
  • Windows PowerShell remoting features
    If you need to managing remote machines, the Disconnected Sessions feature (introduced in Windows PowerShell 3.0) can make your life much easier. The remote debugging features in Windows PowerShell 4.0 can also help. For more information, see about_Remote_Disconnected_Sessions.
  • Performance improvements
    The parser in Windows PowerShell 3.0 significantly improved performance.
  • Feedback
    Little bugs in Windows PowerShell may have been fixed in the latest version. If they haven’t, we need your input, so report them on the Windows PowerShell Customer Connection site.

Best of all, these improvements are additive. The scripts you wrote in Windows PowerShell 2.0 should continue to work in Windows PowerShell 4.0.

For more information about improvements, see What's New In Windows PowerShell.

Note  I’m not suggesting that you should upgrade everything without any testing. I’m simply saying that backwards compatibility is a huge priority for the team, so things should go fairly smoothly.

You stay ahead of the curve

Let’s say you can’t convince your management team that all of these improvements are worth it. I still think it’s worth your while to upgrade one or two machines to the latest version of Windows PowerShell. By doing so:

  • You can come up to speed on the new features without impacting your production environment.
  • You continue to grow your Windows PowerShell skills.
  • When you do upgrade to Windows Server 2012 R2 or Windows 10, you’ll be ready to take advantage of the new features.

Your feedback makes it better

If you do upgrade to the latest version of Windows PowerShell, you have a unique opportunity to improve it for everyone—especially if you’re using the latest WMF Preview. If you’re trying out new features and you think that they can be improved, please provide feedback via the Windows PowerShell Customer Connection site. Well thought out feedback can shape the priorities and the direction of the product.

To summarize, upgrading to the latest version of Windows PowerShell is a good idea because:

  • Newer versions have productivity-boosting features.
  • You continue to grow your Windows PowerShell skills.
  • Your feedback shapes the future direction of Windows PowerShell.

Thank you!

~John

Thanks, John, for taking the time to share with our readers.

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy 

Comments (2)

  1. Chen V says:

    PowerShell 4.0 has many interesting features. One of my favorite is

    Using Foreach and Where without pipleline

    #PowerShell 4.0
    Measure-Command {
    (65..90).Foreach({[char][int]$_}) }

    Measure-Command {
    65..90 | %{[char][int]$_}
    }

    #PowerShell 4.0
    Measure-Command {
    (65..90).Where({$_ -gt 80})}

    Measure-Command {
    (65..90) | ? {$_ -gt 80}}

Skip to main content