Managing PowerShell Modules

by Sep 17, 2009

In PowerShell v.2, all new modules work like libraries and can be loaded using Import-Module to gain access to all public functions, variables, aliases etc. like this:

Import-Module path_to_module\mymodule.psm1

A better way is to store a reference to your module in a variable which requires the -passthru parameter:

$module = Import-Module path_to_module\mymodule.psm1 -passThru

$module | Get-Member will show you all the useful methods you can now access. For example, it tells you just which functions, aliases, variables, etc. are available from this module.

Twitter This Tip! ReTweet this Tip!