Loading...

Typos or module not installed? Azure PowerShell now provides in tool assistance

Typos or module not installed? Azure PowerShell now provides in tool assistance

Starting with Az v8.2.0 we are providing suggestions when PowerShell cannot find a command, as shown in the animated GIF. We not only detect typos, but also many other use cases such as when the required module is not installed.

 

Azure PowerShell gives a suggestion against a typo in the command name.Azure PowerShell gives a suggestion against a typo in the command name.

Use cases

 

Typo

 

For typos, Azure PowerShell tries to find commands that are similar to the input. If any are found, the candidates will be displayed as recommendations.

To do this, we maintain a static table of mappings from all the commands to modules. The table ships with each release of Az.Accounts module. Because of this, no network requests are involved in the recommendation process. The file to store the mappings takes around 300 KB of disk space after installation. But the size of the package is increased by merely 60 KB.

 

Module not Installed or Outdated

 

One of the biggest reason a command cannot be found is that the corresponding module is not installed. It could be the module is in preview, so it is not included in the Az rollup module. Or the modules were installed separately rather than via the rollup module.
A similar case is that an older version of the module is installed but the command is introduced in a newer version.
In both cases, Azure PowerShell tries to figure out which Az module needs to be installed or updated. Suggestions are displayed accordingly.

 

Azure PowerShell suggests user to install the module when a command is not recognized.Azure PowerShell suggests user to install the module when a command is not recognized.

 

Command Deprecation

 

Breaking changes are sometimes inevitable. To reduce the effort of upgrading, Azure PowerShell displays warning messages for the upcoming breaking changes. We also created migration guides for each major release. Now, leveraging this feature, we have added real-time inline suggestions for deprecated commands.
In such case, Azure PowerShell displays a message to explain the reason and guide user to the migration documents.

 

Azure PowerShell warns about deprecated commands.Azure PowerShell warns about deprecated commands.

Note that the message is only for commands that have been deprecated. There is another system to preannounce upcoming breaking changes, and that will not be affected.

 

Advantages

 

  • Quick response. In our test, the worst-case end-to-end time is no longer than 150 milliseconds. The latency introduced by intelligent recommendation was not noticeable.
  • Compatibility. Both PowerShell 7 and Windows PowerShell are supported.

 

Limitations

 

  • The intelligent recommendation system is triggered only when the command matches Azure PowerShell pattern (“*-Az*”) due to performance considerations.
  • To enable the feature, the Az.Accounts module needs to be imported.

 

Feedback

 

This feature is already available. Feel free to share your experience in the comments below or GitHub discussions. We welcome your feedbacks!

 

Published on:

Learn more
Azure Tools Blog articles
Azure Tools Blog articles

Azure Tools Blog articles

Share post:

Related posts

Coding at the Speed of Innovation: AI and more with Azure SQL Database

The Azure SQL Database team is all set to unveil new product announcements as Build 2024 approaches. Innovation is the prominent theme this ti...

1 day ago

Generate insights from audio and video data using Speech analytics in Azure AI Studio

In this video, we explore the power of speech analytics in Azure AI Studio to extract insights from audio and video data. This technology help...

1 day ago

Azure Custom Policy- PostgreSQL Product - Compliance Report not Available- New Feature Request

If you're attempting to create custom policies for Azure Cosmos DB for PostgreSQL at the subscription level and are running into issues where ...

1 day ago

Microsoft Causes Fuss Around Azure MFA Announcement

Microsoft's recent announcement regarding the requirement of Azure MFA for connections to services starting in July 2024 has caused quite a st...

1 day ago

PostgreSQL for your AI app's backend | Azure Database for PostgreSQL Flexible Server

If you want to use Postgres as a managed service on Azure and build generative AI apps, then the Azure Database for Postgres Flexible Server i...

1 day ago

Storage migration: Combine Azure Storage Mover and Azure Data Box

If you are looking to migrate your data from on-premises to Azure Storage, it can be challenging, but with Microsoft's solutions, you can make...

2 days ago

Loop DDoS Attacks: Understanding the Threat and Azure's Defense

This article provides a comprehensive overview of Loop DDoS attacks, a sophisticated and evolving cybersecurity threat that exploits applicati...

2 days ago

Azure Communication Services at Microsoft Build 2024

Join us for Microsoft Build 2024, either in-person in Seattle or virtually, to learn about the latest updates from Azure Communication Service...

2 days ago

Azure Developer CLI (azd) – May 2024 Release

The Azure Developer CLI (`azd`) has received a May 2024 update, version 1.9.0, making it simpler for developers to create, manage, and deploy ...

2 days ago

Join us at Build 2024: Get the latest on Azure Cosmos DB in Seattle or online!

Join Microsoft Build 2024 to get a sneak peek into the future of AI and data innovation. Taking place in Seattle and online from May 21 to 23,...

2 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy