3 ms·
There is auto-complete support. I just tested it (not a powershell user myself), and it seems pretty intelligent. For example, if you type dir | sort <TAB
by captainmuon 10y ago
There is auto-complete support. I just tested it (not a powershell user myself), and it seems pretty intelligent.
For example, if you type
dir | sort <TAB>
it suggests Attributes, BaseName, CreationTime, .... All properties of file objects (which is what dir returns).
Also there is PowerShell ISE, which is a IDE for powershell, but I haven't really tried it yet.
- cm2187 10y agoThat's not what I mean by autocomplete. What I mean is more like Visual Studio's intellisense, ie a drop down that lets you know what are all the options from there. You can type DIR <TAB>, that won't tell you that you can apply the parameters "/p" or "/w" nor what these parameters mean. ISE does a slightly better job but is based on a static specs, rather than the current state of the system. So it won't list the VM names currently active in the system for instance. Yes you can type -?, but that's as bad as having to go on the web to read the documentation. It's disruptive. The point of a good auto-complete is to have a list at your fingertips with a short description of what it does, without interrupting your train of thought.
- Already__Taken 10y agoThe ise can do that if you've got the object at the time you're writing like that, it can't run a command for you as your typing it. You'll never get a drop down list in the host terminal windows has it doesn't have a GUI layer like that. Wrap it in a electron app and make one. you can type `dir -<tab>` and cycle through the options. type `get-help dir` to see what they do or install posh-git and use `dir -<ctrl-space>` to get a menu of options to choose. I didn't know about -?
- jodrellblank 10y agoYou'll never get a drop down list in the host terminal windows has it doesn't have a GUI layer like that. Except you do, with PSReadline, built into Windows 10 PowerShell.
- Already__Taken 10y agoSorry yes that's psreadline not posh-git like I commented. I wouldnt' call that a drop down though, that's just adding to the output isn't it? You know I've no idea how that works, could come in handy actually I should learn.
- jodrellblank 10y agoIt's as close to a dropdown as you can get in the CLI without putting GUI elements over the top. Try gci - then ctrl+space The available parameters appear on the screen, you can select one with the arrow keys, and tab, when you choose one and press space, they all disappear again. It's interactive, dynamic, it changes depending on how much of the parameter name you've typed - it's not just printing to the screen and stuck there.
- NetStrikeForce 10y agoThat's exactly how it works! You can press ctrl+space and it pops out a list of options to choose from, then you move with the arrow keys. It works for parameters and values (if there's a set to choose from): I've taken a screenshot to illustrate: http://i.imgur.com/d7MVYma.png http://i.imgur.com/d7MVYma.png
- Rynant 10y agoIf you type: dir -<Ctrl+Space> PowerShell will list all available parameters below, and allow you to tab through them. The tab completion is not static either. If you type: ps <Tab>, it will tab through all the current processes.
- cm2187 10y agoI you type "Start-VM -name <TAB>", it won't list the list of the VMs, but rather the list of the files in the current directory. That's not exactly what I would call insightful. I didn't know about the CTR+SPACE. That being said it doesn't seem much more insightful than TAB. And no description of what the argument does.
- Rynant 10y agoThe issue with "Start-VM -name <TAB>" is not an issue with Powershell itself, but with the Start-VM cmdlet; the Start-VM cmdlet could have been designed to complete from the list of VMs.