What's New in PowerShell 7.2?
Hey everyone, it's time to get stuck into PowerShell 7.2. PowerShell 7.2 is an important release in the lifecycle of PowerShell as it replaces 7.0 as the next Long Term Support (LTS) release. That means it will have support from Microsoft next 3 years.
How can I Install PowerShell 7.2?
You can grab the 7.2 release here: https://aka.ms/PowerShell-Release?tag=v7.2.0
On Windows desktop operating systems, you can install PowerShell from either the Microsoft Store, or from an MSI. On Windows Servers, you're limited to The MSI. The installation on Linux has also been improved for this release, with one universal package that targets most major flavours of Linux.
Enabling update via Microsoft Update
You can enable Microsoft Update when installing using the MSI:
There are command line options too, but the default is to enable Microsoft Update.
Changing the Look and Feel of PowerShell
Microsoft has introduced a new built-in variable, $PSStyle. You can use that to change the look and feel of PowerShell.
One of the favorite items to change is the table headings, you can do this by setting the $PSStyle.Formatting.TableHeader value, shown below:
Writing PowerShell Faster with Predictive Intellisense
PSReadLine 2.1 ships with PowerShell 7.2, but you need to enable it first. You can enable it using the below command:
Set-PSReadLineOption -PredictionSource History
You also might want to change the colour of the predictions, by default it's a bit hard to see the predictions, see below, it's almost invisible on my monitor:
Here is an example of the prediction with a more readable colour:
If you're using Azure, you can also install a plug-in module that allows you to get Azure specific predictions, install it:
Install-module -name Az.Tools.Predictor -MinimumVersion 0.5.0
Then you can enable it:
Enable-AzPredictor -AllSession