Microsoft has released PowerShell 7, the latest major update to its popular task automation and configuration management framework that can be used on various operating systems.
What is PowerShell?
PowerShell was originally a Windows component, but was open source in 2016 and made available for Windows, macOS, and various Linux distributions.
The system utility includes a command line shell, an object-oriented scripting language and a set of tools for executing scripts, cmdlets (specialized commands that implement specific functions) and manage modules.
PowerShell allows administrators to perform administrative tasks on local and remote systems and network devices. Unfortunately, its capabilities are also exploited by cyber attackers, who increasingly take advantage of tools already deployed in the target environment.
What’s new in PowerShell 7?
Each new version of PowerShell includes new cmdlets / APIs and bug fixes, but PowerShell 7 also comes with several new features:
- Parallelization of pipelines with
ForEach-Object -Parallel
- A simplified and dynamic error view and
Get-Error
cmdlet for easier error investigation - A compatibility layer that allows users to import modules into an implicit Windows PowerShell session
- Automatic new version notifications
- The ability to invoke to call DSC resources directly from PowerShell 7 (still experimental).
- New operators:
- Ternary operator:
a ? b : c
- Pipeline chain operators:
||
and&&
- Null conditional operators:
??
and??=
- Ternary operator:
More details on each are available here.
“The move from PowerShell Core 6.x to 7.0 also marks our move from .NET Core 2.x to 3.1. .NET Core 3.1 brings back a multitude of .NET Framework APIs (in particular under Windows), allowing compatibility much more upstream with existing Windows PowerShell modules, “noted Joey Aiello, program manager at Microsoft for PowerShell Core.
“If you have not been able to use PowerShell Core 6.x in the past due to module compatibility issues, this could be the first time that you will be able to take advantage of some of the impressive features that we have already provided since the launch of the Core project ! “
PowerShell 7 supports a variety of operating systems on x64, including:
- Windows 8.1 and 10
- Windows Server 2012, 2012 R2, 2016 and 2019
- macOS 10.13+
- Red Hat Enterprise Linux (RHEL) / CentOS 7
- Fedora 30+
- Debian 9
- Ubuntu LTS 16.04+
- Alpine Linux 3.8+.
“In addition, we support ARM32 and ARM64 versions of Debian and Ubuntu, as well as ARM64 Alpine Linux,” said Aiello and added that, while not officially supported, the community has also provided packages for Arch and Kali Linux.
Finally, he announced that Microsoft would release a new version of the tool on an annual basis.