Azure PowerShell is one of my preferred ways to build automation and manage Microsoft Azure. However, as Damien Caro (Microsoft Program Manager) mentions, the Azure PowerShell modules has over 4,000 cmdlets and, on average, ten parameters per cmdlet. This can make it hard to find the right cmdlet and parameter for what you want to do. To make this easier, the team created the Az Predictor, an intelligent command completion module for Azure PowerShell. Az Predictor will help you with predictions when you run Azure PowerShell.
In the last couple of days and weeks, I started to try out the new PowerShell Predictive IntelliSense and Az Predictor, and together with the PSReadline version, and I wouldn’t work without it anymore. it kind of reminds me of the AI-supported Azure CLI command in az find.
Az Predictor helps our Azure developers find the cmdlet they are looking for efficiently, identify the required parameters quickly, and experience fewer errors.
Damien Caro – Microsoft Program Manager
We worked closely with the PowerShell team to have Az be the first module that leverages this new interface and bring suggestions to the developer’s fingertips. Az Predictor takes the context of the current session into account in its suggestions. With Az Predictor’s context-aware suggestions users will be guided through the discovery of cmdlets and will not need to go to the online help as often.
You can read more in the official announcement blog on Microsoft Tech Community and preview 2 here.
Az Predictior Modes for Azure PowerShell
Inline mode – Suggestions of parameters and values will appear on the rest of the command line.
Listview mode – This will show several suggestions below the command line with the complete parameter set displayed.
Getting started with Az Predictor
Az Predictor is currently a module in preview in the PowerShell gallery. It leverages the subsystem plugin model that is available after PowerShell 7.2 and used by PSReadline 2.2.2.
You can learn more about this in my PowerShell Deep Dive reaction video.
Requirements
- PowerShell 7.2 (PowerShell 7 can run side by side with Windows PowerShell 5.1)
- PSReadline 2.2.2 – Learn more about PSReadline 2.2.0
Install Az Predictor
To install and get started just follow these easy steps:
- Install PowerShell 7.2
- Install PSReadline 2.2
Install-Module PSReadline -Force
- Install Az.Tools.Predictor preview
Install-Module -Name Az.Tools.Predictor
- Enable the plugins
Enable-AzPredictor -AllSession
- Enable the list view mode (Optional)
Set-PSReadLineOption -PredictionViewStyle ListView
If you want to load Az predictor every time you start PowerShell (and trust me you want that 😉), you can add the last three commands to your PowerShell profile.
I usually use the following in my setup:
Install-Module -Name PSReadline -force
Install-Module -Name Az.Tools.Predictor
Enable-AzPredictor -AllSession
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -Colors @{ InlinePrediction = "$([char]0x1b)[36;7;238m"}
Conclusion and Feedback
I hope this blog provides you with an overview of this awesome new module, which allows you to predict your Azure PowerShell commands. The team is currently looking for feedback so log issues, feature requests, or design changes on GitHub, and take a moment to fill this brief survey.
If you have any questions feel free to leave a comment.
Last modified: November 18, 2022
Hi Thomas – i cant get the history and plugin option to work on pwsh 7.1 it tells me it needs 7.2 , just for info
Hi Ed

Thanks for the comment. it works fine here with PowerShell 7.1. Did you install the PSReadline 2.2.0-beta1
Hi Thomas, same here.
PS C:\Windows\System32> Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption: The prediction plugin source is not supported in this version of PowerShell. The 7.2 or a higher version of PowerShell is required to use this source.
Installed PS 7.1.2 with -Daily, but same error
With PS7.2.0-preview.3 it works great
https://aka.ms/PowerShell-Release?tag=v7.2.0-preview.3
PS /Users/gulzarshaikh/pulumi-qs> Set-PSReadLineOption -PredictionSource HistoryAndPlugin Set-PSReadLineOption: Cannot bind parameter ‘PredictionSource’. Cannot convert value “HistoryAndPlugin” to type “Microsoft.PowerShell.PredictionSource”. Error: “Unable to match the identifier name HistoryAndPlugin to a valid enumerator name. Specify one of the following enumerator names and try again: None, History” PS /Users/gulzarshaikh/pulumi-qs>
I noticed that if I use PS /Users/gulzarshaikh/pulumi-qs> Set-PSReadLineOption -PredictionSource History instead of PS /Users/gulzarshaikh/pulumi-qs> Set-PSReadLineOption -PredictionSource HistoryAndPlugin, it works, it mentions it as a valid parameter