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 Use PowerShell For Loop, While Loop, and Other Loops
May 23, 2022 | Ivan Mirchev
How to Check Your PowerShell Version
May 4, 2022 | Michael Reinders
How to Download a File using PowerShell
Apr 21, 2022 | Michael Reinders
How to Write and Run a PowerShell Script File on Windows 11
Apr 4, 2022 | Ivan Mirchev
Microsoft’s New PowerShell Crescendo Tool Facilitates Native Command-Line Wraps
Mar 21, 2022 | Rabia Noureen
Get-AdUser: How to Audit Active Directory Users with PowerShell
Mar 3, 2022 | Michael Reinders
Most popular on petri