News

Microsoft Commercially Releases PowerShell 7.2

Microsoft this week announced the "general availability" commercial release of PowerShell 7.2.

PowerShell 7.2 is notable for being a long-term support (LTS) release on Windows systems, which means it'll get patches from Microsoft for three years. It'll fall out of support toward the end of 2024, when another version hop would be required.

Steve Lee, a principal software engineer manager on the PowerShell team, explained in the announcement that even-numbered PowerShell versions are the LTS releases. In contrast, the odd-numbered versions just have one year of support.

In a Nov. 8 Twitter post, Lee disclosed that Microsoft is working on releasing future LTS versions of PowerShell for Linux users at some point. "We intend to have an LTS channel for Linux packages so you can just go from LTS to LTS (skipping the intermediate stable release)."

.NET 6 Support
Another notable aspect of PowerShell 7.2 is that it's supported using the .NET 6 platform, which Microsoft commercially released earlier this month. .NET 6 comes with PowerShell 7.2, so there's no need to install .NET 6 first.

"PS7 ships with the required version of .NET," Lee explained in the Nov. 8 Twitter post, where he was replying to a question on whether .NET 6 needs to be installed.

Microsoft Update Support
PowerShell 7.2 newly adds an automatic updates capability via the Microsoft Update service. Automatic updates is the default installation configuration with PowerShell 7.2, but users can opt out of it during the installation process if they prefer manually installing product updates.

PowerShell 7.2 is a "stable" release that can run side-by-side with a preview version of PowerShell. If users want the automatic updating, though, then they have to use the stable version (7.2) of the product.

It's best to use the MSI installer to install PowerShell 7.2 as doing so turns on the automatic update feature. Microsoft also offers PowerShell 7.2 from the Microsoft Store, but there's a catch for Windows Server users, Lee explained:

If you install from the Microsoft Store, then PowerShell 7 will also be automatically updated, however, you would need to install the MSI on Windows Server to get the automatic update capability as the Microsoft Store is not supported on Windows Server.

PowerShell 7.2 users can configure update support to optionally use Windows Server Update Services, System Center Configuration Manager and the Windows Update service. It's done via some command-line options, as described in this "New Features" document.

Predictive Intellisense
PowerShell 7.2 adds the Predictive Intellisense feature via the PSReadLine 2.1 module. It's a time-saving feature for scripters. Based on the user's past PowerShell scripting history, this feature will offer to complete a script. It's is done by showing gray-colored text after a cursor point as the user types.

Users who want the Predictive Intellisense feature must download and install the PSReadLine 2.1 module. They also have to enable this feature, as it's disabled by default. Microsoft explained such details in this post.

Text Decorations
Some new features in PowerShell 7.2 add cosmetic flourishes. One of them is the ability to add text "decorations" (such as changing the color of text for metadata) within the PowerShell console via ANSI escape sequences, which are bracketed text commands.

Another cosmetic addition in PowerShell 7.2 is the $PSStyle cmdlet. It lets users decorate "scripts or cmdlets as well as control use of ANSI escape sequences," Lee explained. Users can change text colors or add italics or background colors, for instance. The changes that are made will persist if "stored in your $Profile," he added.

Desired State Configuration Module Separation
With PowerShell 7.2, the PSDesiredStateConfiguration module was separated, although it can be gotten from the PowerShell Galley.

Microsoft separated this DSC module because doing so "allows the PSDesiredStateConfiguration module to be developed independently of PowerShell and users can mix and match versions of PowerShell and PSDesiredStateConfiguration for their environment," the "New Features" document explained.

PowerShell 7.3 in 2022
Lee noted that some new features that didn't make PowerShell 7.2 will show up in PowerShell 7.3, Microsoft's next major product release. More info on PowerShell 7.3 will be coming "in the first quarter of 2022."

About the Author

Kurt Mackie is senior news producer for 1105 Media's Converge360 group.

Featured

comments powered by Disqus