Skip to content

Disable / Enable functionality #6

@briantist

Description

@briantist

Is there a way to avoid turning this on automatically, or selectively enabling / disabling it?

I see the Start-HumpCompletion and Stop-HumpCompletion, but they seem to only set the value of $Global:HumpCompletionEnabled (a variable which is also set to $true by default at the end of loading the module), but I don't see that variable referenced elsewhere.

Because this must work by replacing TabExpansion2 I'm wondering if there's a way I can better control that this gets enabled, and a way to disable it explicitly.

This is of most concern because of module auto-loading, which can be triggered by many things, and because the ideal of way of installing this (Install-Module) is going to put it in an auto-loading capable place.

It's of course possible to Save-Module and put it somewhere locally, but this means breaking out of using the standard way of managing modules.

For me, ideally, this functionality is disabled by default, and you must explicitly call Start-HumpCompletion to replace TabExpansion2. This can then go into the appropriate $PROFILE based on who wants it to be loaded automatically in their session.

Advantages

  • Proper module management (the module can be kept global and allowed to use for anyone who wants to)
  • Can be loaded in profiles giving control over different environments, at different scopes (admin can enabled everywhere, individuals can enable / disable at will, etc.).
  • Can be avoided in scheduled tasks and other invocations regardless of profile by invoking powershell.exe -NoProfile
  • Helper functions for adding it to a profile can be included (a la posh-git's Add-PoshGitToProfile)

Looking forward to hearing your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions