Add Azure CLI Tab Completion for Windows PowerShell

This blog post will show you how to add Azure CLI Tab Completion for Windows PowerShell.

Azure CLI (Command Line Interface) is a tool for managing Azure services. It’s designed to be easy and efficient for administrators and developers.

Tab completion, a feature in many command-line environments, automatically fills in partially typed commands. It increases productivity by reducing the amount of typing.

For Windows PowerShell users, enhancing the Azure CLI with tab completion isn’t built-in. You need to set it up manually. This setup improves command accuracy and speeds up your workflow. It’s a valuable addition for anyone regularly using Azure CLI.

Create a PowerShell profile

To get started, you must first create a PowerShell profile if it doesn’t exist. This profile file will hold custom scripts that enhance PowerShell’s functionality. Use the following script to create a profile:

Then, open the profile and copy the Tab Completion code.

After creating or confirming the existence of your profile, the next step involves enhancing your Azure CLI experience.

Add Tab Completion Code

You’ll inject a script into this profile that enables tab completion. Here’s the script to add:

Once you save this script into your profile, restart PowerShell. Now, you can enjoy tab completion. Simply type ‘az’ followed by a space, press the tab key, and see the magic. This feature is sure to simplify your command executions in Azure CLI.

Processing…
Success! You're on the list.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.