An Introduction to PowerShell Modules
Upcoming SlideShare
Loading in...5

Like this? Share it with your network

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 626 623 2 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. An Introduction to PowerShell Modules
    Jonathan Medd
  • 2. How can you distribute additional PowerShell functionality?
    Snapin – PowerShell v1
    Provider or Cmdlets
    Not for your average IT Pro to create
    Module – PowerShell v2 (Snapins still available)
    Provider, Cmdlets, Functions, Variables and Aliases
    Any 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 professional
    Stored within a folder as a subfolder of the Modules location. Can be found via $env:PSModulePath
    Contents made accessible to the user via the Import-Module cmdlet
  • 4. Why bother?
    Makes sharing of groups of functions and scripts easy
    Simple XCOPY style deployment of the module folder either internally or publishing to an external website
    Make your commonly used functions available to yourself without ‘Profile Bloat’ – they are available as and when you need them from a module
  • 5. Modules can transform you from this:
  • 6. To Superstars with Groupies:
  • 7. More on the module that made that transformation happen later........
  • 8. Buy This Book
  • 9. Making Your First Module
    Create two functions
    Save them into a *.psm1 file to the module folder
    Import them for use into your session
    Yes it is as easy as that
  • 10. Demo – Create a Module
  • 11. Making Your Module More Professional
    Create a Module Manifest using New-ModuleManifest
    Include Authoring or Version info
    Specify minimum versions of PowerShell or .NET required for the module
    Nest other modules
    Run scripts prior to loading the module, e.g. check for third-party snapin dependencies
    Can be created manually
    Use Test-ModuleManifest to check for issues
  • 12. Demo – Create The Manifest
  • 13. Modules Make Distributing Your Code Easier
  • 14. Demo – PowerCLIBook Module
  • 15. Other Modules
    Windows Server2008 R2 ->
    Community Modules
    PowerShell Community Extensions
    BSonPOSH Module
    Search on – currently 50+
  • 16. Demo – TroubleShootingPack Module
  • 17. Wrap Up
    Get-Help about_Modules