What’s New in PowerShell 7.1
The latest versions of PowerShell are not included out-of-the-box with Windows 10. So, you might not know that PowerShell is already on version 7.1 The version in Windows 10 is called Windows PowerShell 5.1 and it is no longer being developed. But it is still supported by Microsoft. PowerShell versions 6 and later are cross-platform, and work on Windows, macOS, and Linux.
PowerShell 7.1 was released late in 2020. It builds on PowerShell 7.0 and it fixes issues reported by users. There are also a few improvements. PowerShell 7.0 was released in March 2022 and it came with several new features:
- Pipeline parallelization with ForEach-Object -Parallel
- New operators:
- Ternary operator: a ? b : c
- Pipeline chain operators: || and &&
- Null conditional operators: ?? and ??=
- A simplified and dynamic error view and Get-Error cmdlet for easier investigation of errors
- A compatibility layer that enables users to import modules in an implicit Windows PowerShell session
- Automatic new version notifications
- The ability to invoke DSC resources directly from PowerShell 7 (experimental)
PowerShell 7.1 is based on .NET Core 5.0
This release of PowerShell is based on .NET Core 5.0. PowerShell 7.0 was based on .NET Core 3.1. PowerShell 7.1 is part of the Stable release branch and it is also the first version to be published in the Microsoft Store. When you install PowerShell from the Store, Windows 10 automatically keeps PowerShell up to date. If you’d prefer to install PowerShell 7.1 using a downloaded install package, check out Microsoft’s instructions for installing PowerShell on Windows, macOS, and Linux.
But because Store apps are restricted by design in Windows 10, you can’t establish PowerShell Remoting sessions using WSMAN to Store-based installs of PowerShell. However, SSH remote sessions are supported.
Tab completion lets you start typing a command and then by pressing the TAB key, have the rest of the command completed for you. But because of the sheer number of available PowerShell cmdlets, tab completion has become less effective.
The PSReadLine module adds Predictive Intellisense, which uses the history of cmdlets you typed to predict what command you want to use. In PowerShell 7.0, you needed to download the PSReadLine module manually. PSReadLine is now included in PowerShell 7.1.
PSNullConditionalOperators and PSUnixFileStat are mainstream in PowerShell 7.1. PSNullConditionalOperators introduces new operators for Null conditional member access operators – ?. and ?. And PSUnixFileStat adds data from the Unix stat API in the output of the file system provider to provide a more Unix-like file listing.
More in PowerShell
How To Set Environment Variables With PowerShell
Dec 5, 2022 | Sukesh Mudrakola
How to Use a PowerShell Foreach Loop
Oct 24, 2022 | Ivan Mirchev
How to Use a PowerShell Array
Oct 19, 2022 | Michael Reinders
Filtering with PowerShell Where-Object: Easy Examples
Oct 10, 2022 | Michael Reinders
What is PowerShell and How to Get Started With It?
Sep 7, 2022 | Mike Kanakos
Use a PowerShell Substring to Search Inside a String
Aug 11, 2022 | Jeff Hicks
Most popular on petri