PSEverything icon indicating copy to clipboard operation
PSEverything copied to clipboard

Suggestion: consider not providing command aliases (se, sles)

Open nightroman opened this issue 2 years ago • 4 comments

Thank you for the great module which is very well designed and really handy.

Everything looks thought through except one tiny bit, the exposed aliases. They turns out to be intrusive, i.e. they clash with my own pet aliases.

Aliases are handy indeed as such... but they are up to users. Ironically es and sles are more likely to hurt exactly users who value and use aliases.

Some thoughts from @KirkMunro in his blog post To alias, or not to alias.

nightroman avatar Jun 06 '22 13:06 nightroman

Import-Module -Cmdlet Select-EverythingString, Search-Everything

will only import the functions. Or force-set your aliases.

powercode avatar Jun 06 '22 13:06 powercode

Here is the typical gotcha:

  • My aliases are set in the profile for interactive sessions
  • Then I invoke Search-Everything in a session
  • PSEverything is auto imported and overrides my aliases

Note that in my usual scenario I do not have to explicitly import PSEverything. And this is very good, because sometimes I need the module, but most of the time I do not need it in a session. Handy module auto import does the trick.

nightroman avatar Jun 06 '22 13:06 nightroman

So the suggested workarounds are unfortunately not very handy

will only import the functions

Then I have to remember typing this command and remember not to trigger auto loading unintentionally

Or force-set your aliases

Then I have to import the module always (I do not really need this) before setting my aliases.

nightroman avatar Jun 06 '22 13:06 nightroman

I've considered this, and I think the right thing is to release the module with a new major version without the aliases.

powercode avatar Oct 28 '22 06:10 powercode