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

Like this? Share it with your network

Share
  • 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

Views

Total Views
2,342
On Slideshare
1,716
From Embeds
626
Number of Embeds
3

Actions

Shares
Downloads
30
Comments
0
Likes
0

Embeds 626

http://www.jonathanmedd.net 623
http://feeds.feedburner.com 2
http://webcache.googleusercontent.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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
    Go!
    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
    VS
  • 14. Demo – PowerCLIBook Module
  • 15. Other Modules
    Windows Server2008 R2 ->
    Community Modules
    PowerShell Community Extensions
    BSonPOSH Module
    SQLPSX
    Search on http://www.codeplex.com – currently 50+
  • 16. Demo – TroubleShootingPack Module
  • 17. Wrap Up
    Get-Help about_Modules
    http://www.simple-talk.com/sysadmin/powershell/an-introduction-to-powershell-modules/
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/01/18/hey-scripting-guy-january-18-2010.aspx