Aliasing a module

This topic contains 2 replies, has 2 voices, and was last updated by  qbrt 4 weeks ago.

  • Author
    Posts
  • #101226

    qbrt
    Participant

    I am unable to find this anywhere on the internets.

    I understand that functions and cmdlets can be aliased using Set-Alias.

    My question, can a module name be aliased?

    For example, I have two modules that have cmdlet name collision (Get-Noun in Module1, and Get-Noun in Module2)
    Both module names are long, Microsoft.System.Automation.MoreNameSpaces1. I am not a fan of prefixing nouns in the Verb-Noun, but don't mind using the module name as part of the cmdlet call. In this case it would be Microsoft.System.Automation.MoreNameSpaces1\Get-Noun. So this can get ridiculous pretty fast.
    Is there a way to have another name (alias) to the module itself like: Set-Alias -Name Microsoft.System.Automation.MoreNameSpaces1 -Value ms1
    And then use cmdlets is this way: ms1\Get-Noun

    Hope I'm being clear.
    Thank you in advance.

  • #101227

    Don Jones
    Keymaster

    Nope.

  • #101230

    qbrt
    Participant

    haha. Please don't be so -Verbose!
    t/y

You must be logged in to reply to this topic.