ModuleHelper - Automatically Create Modules and Save Functions to it


posted by Tobias
10-19-2011

Downloads: 369
File size: 4.3kB
Views: 1,107
ModuleHelper - Automatically Create Modules and Save Functions to it
Filed under: , ,

This module  makes creation of PowerShell modules very easy. This is revision 2 which fixes a problem that could lead to duplicate param() blocks in the module script.

When you have a function that you want to add to a module, or when you want to create your own modules from scratch, import my module and then do this:

Out-Module -Module myTools -Function SomeFunction

This will save the function SomeFunction into the module myTools (and creates the module if it does not exist). You can then see your module:

Get-Module -ListAvailable

And you can import your new module and use all the functions you saved to it:

Import-Module myTools

Get-Command -module myTools

Have fun!

Tobias Weltner (Microsoft MVP PowerShell)

P.S. I am doing PowerShell trainings throughout Europe, including basic classes, advanced classes, specialties like AD/GPO/Exchange and also VBScript2PowerShell-Guerilla workshops. Drop me a line: tobias.weltner@email.de!

 

Comments

Richard Giles wrote re: ModuleHelper - Automatically Create Modules and Save Functions to it
on 10-19-2011 7:48 AM

Very useful.

Hecktor wrote re: ModuleHelper - Automatically Create Modules and Save Functions to it
on 12-01-2011 10:02 AM

Great Information from the Powershell team!

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.