[November 2021: Updated version of PowerShell and PowerShellGet]
Last November, we announced the first preview of Az Predictor, a PowerShell module for Azure that brings to your fingertips the entire knowledge of the Azure documentation customized to your current session.
Today we are announcing a new preview and we want to share some clarity on our plans for the next few months.
Since the release of the first preview, we listened to customer feedback and identified some challenges.
The module now exposes two cmdlets ‘Enable-AzPredictor’ and ‘Disable-AzPredictor’ to automatically import the module and configure PSReadline. The cmdlet also allows users to enable the settings for future sessions by updating the user’s PowerShell profile (Microsoft.PowerShell_profile.ps1).
Az.Tools.Predictor required API changes to the PowerShell engine to improve suggestions (requiring PowerShell 7.2 preview 3 or later).
You can now use dynamic completers to easily navigate through the parameter value with the ‘Alt+A’ combination.
We are continuously improving the model that is serving the predictions displayed on your screen. This is the most important and invisible piece of software that makes the magic! The most recent update of the model now comprises the missing modules.
If you have installed the first preview:
To install the second preview of Az.Tools.Predictor follow these steps:
Install-Module -Name PSReadLine -AllowPrereleaseMore details about PSReadline: https://www.powershellgallery.com/packages/PSReadLine/2.2.0-beta4
Install-module -name Az.Tools.Predictor -RequiredVersion 0.5.0More details about Az.Tools.Predictor: https://www.powershellgallery.com/packages/Az.Tools.Predictor/0.5.0
Enable-AzPredictor -AllSessionThis command will enable Az Predictor in all further sessions of the current user.
Note: Due to underlying API breaking changes, Az.Tools.Predictor preview 3 or newer are not compatible with PowerShell 7.2.0-preview.6 or newer. Upgrade to preview 5 of Az.Tools.Predictor to be compatible with PowerShell 7.2.0-preview.6 or newer and PS Readline 2.2.0-beta3 or newer.
Once enabled, the default view is the "inline view" as shown in the following screen capture:
This mode show only one suggestion at a time. The suggestion can be accepted by pressing the right arrow or you can continue to type. The suggestion will dynamically adjust based on the text that you have typed.
You can accept the suggestion at any time then come back and edit the command that is on your prompt.
This is definitely my favorite mode!
Switch to this view either by using the "F2" function key on your keyboard or run the following command:
Set-PSReadLineOption -PredictionViewStyle ListView
This mode shows in the a list down your current prompt a list of possible match for the command that you are typing. It combines suggestions from the history as well as suggestions from Az Predictor.
Select a suggestion and then navigate through the parameter values with "Alt + A" to quickly fill replace the proposed values with yours.
We are looking for feedback on this second preview.
We will continue to improve our predictor in the coming months. Stay tuned for our next update of the module.
Tell us about your experience. What do you like or dislike about Az Predictor? http://aka.ms/azpredictorsurvey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.