Microsoft releases PowerShell 7 for Windows, macOS and Linux

Microsoft has released PowerShell 7, the latest major update to its popular task automation tool and configuration management framework that can be used on various operating systems.

PowerShell 7

What is PowerShell?

PowerShell was initially a Windows component, but was open-sourced in 2016 and made available for Windows, macOS and various Linux distributions.

The system utility includes a command-line shell, object-oriented scripting language, and a set of tools for executing scripts, cmdlets (specialized commands that implement specific functions) and managing modules.

PowerShell enables administrators to perform administrative tasks on both local and remote systems and network devices. Unfortunately, its capabilities are also exploited by cyber attackers, who increasingly take advantage of tools that are already deployed in the target environment.

What’s new in PowerShell 7?

Each new PowerShell version includes new cmdlets/APIs and bug fixes, but PowerShell 7 also comes with several new features:

  • Pipeline parallelization with ForEach-Object -Parallel
  • 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 to invoke DSC resources directly from PowerShell 7 (still experimental).
  • New operators:
    • Ternary operator: a ? b : c
    • Pipeline chain operators: || and &&
    • Null conditional operators: ?? and ??=

More details about each are available here.

“The shift 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 host of .NET Framework APIs (especially on Windows), enabling significantly more backwards compatibility with existing Windows PowerShell modules,” noted Joey Aiello, Program Manager at Microsoft for PowerShell Core.

“If you weren’t able to use PowerShell Core 6.x in the past because of module compatibility issues, this might be the first time you get to take advantage of some of the awesome features we already delivered since we started 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+.

“Additionally, we support ARM32 and ARM64 flavors of Debian and Ubuntu, as well as ARM64 Alpine Linux,” Aiello pointed out and added that, while not officially supported, the community has also provided packages for Arch and Kali Linux.

Finally, he announced that Microsoft will be releasing a new version of the tool on an annual basis.

Don't miss