PowerTip: Import Only Aliases and Functions from a PowerShell Module

Doctor Scripto

Summary: Use parameters of Import-Module to control what you import from a Windows PowerShell module.

Hey, Scripting Guy! Question How can I import only custom aliases and functions from a Windows PowerShell module?

Hey, Scripting Guy! Answer 1. Use the –Function and –Alias parameters, and use wildcard characters to control the import (ipmo is an alias for Import-Alias):

ipmo pscx -Function * -Alias *

  2. Use the Get-Command cmdlet to verify the import (gcm is an alias for Get-Command and –mo is short for –Module):

gcm -mo pscx

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

0 comments

Discussion is closed.

Feedback usabilla icon