PowerTip: Provide Alternate Name to Nouns in Module


Summary: Use Windows PowerShell to provide alternate names to nouns in modules to avoid conflicts.

Hey, Scripting Guy! Question How can I use Windows PowerShell to avoid the problem of having conflicting cmdlet names in different modules?

Hey, Scripting Guy! Answer Use the Prefix parameter with Import-ModulePrefix will take whatever letter segment you provide and
           add that before the noun in all the cmdlets for a module you load. For example, if I want to make sure all the
           cmdlets in the UEV module have HSG before the noun, I would type:

Import-Module UEV –prefix HSG


Comments (1)

  1. Joel "Jaykul" Bennett says:

    But don’t actually use this feature, as it will break modules which take a dependency on the one you prefixed.

Skip to main content