你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Intelligent context-aware command completion with Az Predictor
Overview
Az Predictor is a PowerShell module that helps you navigate the cmdlets and parameters of the Az PowerShell module. It provides intelligent context-aware suggestions for command completion when using Azure PowerShell.
Az Predictor uses the subsystem plugin model available in PowerShell 7.2. This updated version requires PSReadLine 2.2.2 or higher to display suggestions.
Prerequisites
Required configuration for Az Predictor:
- PowerShell 7.2 or higher
- PSReadline 2.2.2 or higher
Install the latest version of PSReadLine:
Install-Module -Name PSReadline
Getting started
Install Az Predictor
Install the Az.Tools.Predictor PowerShell module
Install-Module -Name Az.Tools.Predictor
Enable Az Predictor
Enable Az Predictor for the current and future PowerShell sessions.
Enable-AzPredictor -AllSession
Set your preferred view for suggestions.
Enable list view:
Set-PSReadLineOption -PredictionViewStyle ListView
Enable inline view:
Set-PSReadLineOption -PredictionViewStyle InlineView
Note
You can switch between view modes with the F2 key.
Uninstallation
Once installed and enabled, Az Predictor is loaded in the PowerShell profile. To uninstall the Az.Tools.Predictor module:
Close all PowerShell sessions, including VS Code.
Launch a PowerShell session with no profile.
pwsh -noprofile
Uninstall Az Predictor
Uninstall-Module -Name Az.Tools.Predictor -Force
Close PowerShell
Privacy and data collection
Privacy
Az predictor uses the previous two Az cmdlets to make suggestions and ignores any cmdlet that's not part of the Az PowerShell module. Only the names of cmdlets and parameters are sent to our API to obtain the suggestion. Parameter values are discarded. The resource group name and location used are kept locally and reused with subsequent cmdlets for convenience but are never sent to the API. In the preview version, the module generates and sends anonymized information about the current session used for predictions to the API. This information is used to assess the quality of suggestions.
Data collection
The current version of Az Predictor collects anonymized information about its usage to identify common issues and improve the experience of future releases. Az Predictor doesn't collect any private or personal data.
For example, the usage data helps identify inaccurate suggestions and issues like interferences with PSReadLine. While we appreciate the insights this data provides, we understand not everyone wants to send usage data. You can disable data collection with the Disable-AzDataCollection cmdlet. You can also read our privacy statement to learn more.