Announcing Az Predictor

The Azure PowerShell modules expose over 4,000 cmdlets and, on average, ten parameters per cmdlet. Experienced PowerShell users will find the right cmdlet and parameter to achieve their goal but this can be more complicated for casual users.


I have rarely seen people experimenting with a new module being able to execute a command successfully on their first attempt. With time, this is no more an issue as people get accustomed to the cmdlet and remember the associated parameters, unless you have a terrible memory like me and need to refer to the documentation frequently.

Az Predictor animated GIF


Goals

We built Az Predictor, an intelligent command completion module for Azure Powershell. Az Predictor helps our Azure developers find the cmdlet they are looking for efficiently, identify the required parameters quickly, and experience fewer errors.


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.


To satisfy different working styles, we are offering two modes:

  • Inline mode: a suggestion with parameters and values will appear with some opacity on the rest of the command line. We expect this mode to be more suited for the experienced developers who already understand the cmdlets.

Az Predictor inline mode screen capture

  • List view mode: several suggestions will appear below the command line with the complete parameter set displayed. This mode should be more suited to folks who need to see the command’s full line to know the parameters.

Az Predictor list view mode screen capture


Technical details

Az Predictor is currently a module in preview in the PowerShell gallery. We are looking for feedback on this first preview, and based on what we will hear from customers, we are considering making it part of the Az wrapper module.


The inline view and list view modes are provided by PSReadline to manage the user’s interactions. The plugin is responsible for providing the suggestions to be used by PSReadline.


Az Predictor is built on top of the subsystem plugin model that is available after PowerShell 7.1-preview7 and used by PSReadline 2.2.0-beta1; hence the following configuration is required to try Az Predictor:

  • PowerShell 7.1+

  • PSReadline 2.2.0-beta1 – Learn more about PSReadline 2.2.0


Note: If you are using Windows PowerShell