4 ms·
I know what you mean, but discoverability is the one area where I think Powershell is actually doing pretty well. The Get-Command cmdlet lets you search cmdlets
by AcerbicZero 7y ago
I know what you mean, but discoverability is the one area where I think Powershell is actually doing pretty well. The Get-Command cmdlet lets you search cmdlets by Module, Verb, Noun, etc, and supports all kinds of wildcards. Plus the built in help (aliased to man) is usually very detailed and provides numerous examples.
I think the bigger issue is that MS stuffs all the modules you don't need into every session, so when you want to do something simple against your DHCP server, you also have to tab past all your AD, SAN, NFS, etc, etc cmdlets in the process, which is just dumb.
- stinos 7y agoyou also have to tab past all Or do Ctrl-Enter to get the list of all matches and navigate with arrow keys, should be faster. Thinking of it, I don't really need discoverability often but if I did I'd probably resort to Get-Command | %{$_.Name} | fzf bound to a key or so: this gives you fuzzy matching search of all possible commands. I just tried, 1683 commands in total and this got me all Smb commands in about the amount of time it took me to type 'SMb. It doesn't get better than that. Well, except that you could have fzf split the screen and show the help for each command there. This is also the typical PS (or other shells for that matter) story: people complaining about not being able to do discoverability whle in fact the there are actually some seriously good options but it's those options which are hard to discover :)
- Ididntdothis 7y ago”some seriously good options but it's those options which are hard to discover :)” That’s modern UX for you. Hide features to the degree that only a lucky few will ever find them :). A lot of websites and mobile apps have adopted that philosophy.
- jodrellblank 7y agoI don't recognise fzf as a tool, but is that better than get-command *smb* for fuzzy matching? Incidentally you can do get-command |% Name To avoid having to write that {$_.} wrapping blob all the time, if you're merely expanding a property or calling a method on every object in the pipeline.
- stinos 7y agofzf is https://github.com/junegunn/fzf https://github.com/junegunn/fzf, I prefer it over get-command smb because: - it's fuzzy and more i.e. https://github.com/junegunn/fzf#search-syntax https://github.com/junegunn/fzf#search-syntax - gives you a list which you can shrink further, again with fuzzy matching - list can be navigated using keyboard, and then selected from To avoid having to write that {$_.} Heh, I actually didn't know that. Or forgot.