July 1st, 2013

PowerTip: Import Specific Cmdlets from a Module

Doctor Scripto
Scripter

Summary: Selectively import specific cmdlets when you import a module.

Hey, Scripting Guy! Question How can I import only cmdlets that use the verb Get from the PSCX module?

Hey, Scripting Guy! Answer Call the Import-Module cmdlet, specify the cmdlet parameter, and use a filter to get only cmdlets with the verb Get (ipmo is an alias for Import-Module):

ipmo -Cmdlet get* -Name pscx

Note   For more information about the PSCX module, see Install the PSCX and 80 New Cmdlets to Ease PowerShell Use.

 

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.