Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support autocompletion in command line PowerShell console. #2324

Open
chaliy opened this issue Feb 28, 2017 · 14 comments

Comments

@chaliy
Copy link
Contributor

commented Feb 28, 2017

I am big fun of new Azure CLI 2.0. However my working console is Powershell, is there any chance to get autocomplete for Powershell?

There are many examples of successful integrations to Powershell:

@troydai

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2017

Hi @chaliy thank you for the advice. We will take a look at this during our planning.

Since essentially a PowerShell console is just a Windows command line window, I'll update the subject to reflect the fact that you actually ask for autocompletion in command line window.

In the meantime, since we have autocompletion for bash you can use it on Windows through cygwin or Ubuntu subsystem in Windows 10.

@troydai troydai changed the title Powershell support: autocomplition Support autocompletion in command line windows environment (including PowerShell) Feb 28, 2017

@chaliy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2017

@troydai thanks for response. I believe that PowerShell autocompletion has nothing to do with "windows command line window". In PowerShell you actually alter TabExpansion function to react on your commands. After it's done it will work for any PowerShell environment (PowerShell ISE, PowerShell in Windows Console, etc). It will not affect CMD.

Another good example of tabexpansion implementation is Posh-GIT - https://github.com/dahlbyk/posh-git/blob/master/src/GitTabExpansion.ps1

@troydai

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2017

I see what you're saying. I'll change the subject line.

@troydai troydai changed the title Support autocompletion in command line windows environment (including PowerShell) Support autocompletion in command line PowerShell console. Mar 1, 2017

@tomasaschan

This comment has been minimized.

Copy link

commented Nov 1, 2017

Is there any news on this? I'd love to see this supported as well!

@tjprescott

This comment has been minimized.

Copy link
Member

commented Nov 1, 2017

Powershell is not actively supported by the CLI team, so there are currently no plans for this.

@ChristianSauer

This comment has been minimized.

Copy link

commented Nov 9, 2017

Very sad, since PowerShell is the shell to use in windows.
Honestly, I think it's kind of hilarious, since even docker (a native linux tool!) has better powershell support than a core microsoft product.

@troydai

This comment has been minimized.

Copy link
Contributor

commented Nov 9, 2017

@ChristianSauer thank you for the comments. The Azure CLI 2.0 is designed to be a bash oriented. Its tab completion is supported in bash on Windows as well as cywin and mingw. On the other hand Azure PowerShell CLI is optimized to be used in the PowerShell command line environment, under which it also supports tab completion. The essense of this issue, however, is to support tab completion for Azure CLI 2.0 (a bash-oriented tool) in PowerShell environment.

@kgopi1

This comment has been minimized.

Copy link

commented Apr 27, 2018

Azure CLI is much easy to use rather than Azure Powershell , As we used the PowerShell ISE for script editor , it would be nice if you include teh auto completion azure CLI ... As Docker and other tools supporting , Hope it not big deal for Azure CLI to provide that feature ..

@lafe

This comment has been minimized.

Copy link

commented Aug 11, 2018

@troydai This might be true. However, the documentation and hints jump back and forth from using the CLI tools to PowerShell. I am currently working with Docker and Kubernetes and the Docker commands in the help were in PowerShell and the Kubernetes connection is given in Azure CLI in the Azure Portal. So both tools are required and it would be great to have similar support in both tools.

@yugangw-msft yugangw-msft added this to the Backlog milestone Nov 29, 2018

@Leon99

This comment has been minimized.

Copy link

commented Mar 8, 2019

The Azure CLI 2.0 is designed to be a bash oriented. Its tab completion is supported in bash on Windows as well as cywin and mingw. On the other hand Azure PowerShell CLI is optimized to be used in the PowerShell command line environment, under which it also supports tab completion.

The problem here is that Azure PowerShell CLI only supports a subset of what az can do. Any plans on having one toolset that works equally fine on all both platforms?

@tjprescott tjprescott removed this from the Backlog milestone Mar 8, 2019

@tjprescott

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

At this time we have no plans to add support for Powershell tab completion. The CLI was not designed with Powershell as an intended shell, and while it does work, people generally run into more issues with special characters and so forth. Since the target shell for Azure CLI is bash, our priority is on fully supporting tab completion there, and even in that regard there is much to do.

For other shells, az interactive is currently the only supported mechanism for tab completion.

That being said, if anyone in the community would like to contribute a PR that adds tab completion support for Powershell, we would gladly review it for inclusion.

@chriskuech

This comment has been minimized.

Copy link

commented Apr 8, 2019

Powershell is not actively supported by the CLI team, so there are currently no plans for this.

I just spent an hour trying to get WSL to integrate like a native terminal with unsatisfactory results. Please fully support Windows. Many of the Azure docs only feature az and lack parity with Azure PowerShell.

I have also yet to get tab completion working on WSL bash.

@rroman81

This comment has been minimized.

Copy link

commented Jun 18, 2019

This looks like a sizable undertaking but granted that a large number of PowerShell based users do use Azure CLI, this would be immensely helpful. Anyone wants to start posh-az module? :)

@thomaslevesque

This comment has been minimized.

Copy link

commented Jul 5, 2019

Powershell is not actively supported by the CLI team, so there are currently no plans for this.

That's irrelevant. Look at the dotnet CLI: it doesn't "actively support" PowerShell, but it has a "complete" command, which is shell-agnostic. This command can then be used to integrate with any shell (PowerShell, bash or zsh for instance). Look here for details: https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.