June 25th, 2015

PowerTip: Provide Alternate Name to Nouns in Module

Doctor Scripto
Scripter

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

Category
Scripting

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.