Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Import Only Aliases and Functions from a PowerShell Module

$
0
0

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.


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>