Comments
 
posted on April 19th 2013, at 10:23
by lunarg
To make your custom cmdlets (functions) available in your PowerShell sessions, there are a few methods.

To do a one-time import of functions in your current session, store the functions in a PS1-file and save it somewhere. Then, in your session run the following:

. "path-to-file"

Notice the dot and a space behind it. This method, called "dotting" does a one-time import in the current session. This is useful for when you have functions that you don't use often, and don't want them to be available at all times.

An alternative method is to save the functions as a PSM1-file (extension .psm1) to create a module file, then use Import-Module to import your functions.

Import  ...
Add a new comment
 
Your name:
Your e-mail:
Your comment:
 
Basic BBcode is supported.
Captcha:
Type the letters and numbers as shown.
/get/captcha/1713474537
Not readable? Get another.
 
 
 
 
« April 2024»
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930    
 
Links
 
Quote
« If the batteries of a TV remote run out, why do we press the buttons so much harder? »