This document introduces PowerShell modules as a way to distribute additional PowerShell functionality. Modules allow any IT pro to create and share groups of functions, scripts, and other files. A module is simply a collection of files stored in a folder with an optional manifest file. Importing a module makes its contents accessible to the user. The document demonstrates how to create a basic module with two functions and manifest file, and provides examples of existing community modules available online.
2. How can you distribute additional PowerShell functionality?Snapin PowerShell v1Provider or CmdletsNot for your average IT Pro to createModule PowerShell v2 (Snapins still available)Provider, Cmdlets, Functions, Variables and AliasesAny IT Pro can make a module
3. What is a module?Simple as a collection of files containing functions, scripts etc and possibly other files such as the manifest to make it more professionalStored within a folder as a subfolder of the Modules location. Can be found via $env:PSModulePathContents made accessible to the user via the Import-Module cmdlet
4. Why bother?Makes sharing of groups of functions and scripts easySimple XCOPY style deployment of the module folder either internally or publishing to an external websiteMake your commonly used functions available to yourself without Profile Bloat they are available as and when you need them from a module
9. Making Your First ModuleCreate two functionsSave them into a *.psm1 file to the module folderImport them for use into your sessionGo!Yes it is as easy as that
11. Making Your Module More ProfessionalCreate a Module Manifest using New-ModuleManifestInclude Authoring or Version infoSpecify minimum versions of PowerShell or .NET required for the moduleNest other modulesRun scripts prior to loading the module, e.g. check for third-party snapin dependenciesCan be created manually Use Test-ModuleManifest to check for issues
15. Other ModulesWindows Server2008 R2 ->Community ModulesPowerShell Community ExtensionsBSonPOSH ModuleSQLPSXSearch on http://www.codeplex.com currently 50+