Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
An Introduction to PowerShell  Modules<br />Jonathan Medd<br />
How can you distribute additional PowerShell functionality?<br />Snapin – PowerShell v1<br />Provider or Cmdlets<br />Not ...
What is a module?<br />Simple as a collection of files containing functions, scripts etc and possibly other files such as ...
Why bother?<br />Makes sharing of groups of functions and scripts easy<br />Simple XCOPY style deployment of the module fo...
Modules can transform you from this:<br />
To Superstars with Groupies:<br />
More on the module that made that transformation happen later........<br />
Buy This Book <br />
Making Your First Module<br />Create two functions<br />Save them into a *.psm1 file to the module folder<br />Import them...
Demo – Create a Module<br />
Making Your Module More Professional<br />Create a Module Manifest using New-ModuleManifest<br />Include Authoring or Vers...
Demo – Create The Manifest<br />
Modules Make Distributing Your Code Easier<br />VS<br />
Demo – PowerCLIBook Module <br />
Other Modules<br />Windows Server2008 R2  -><br />Community Modules<br />PowerShell Community Extensions<br />BSonPOSH Mod...
Demo – TroubleShootingPack Module<br />
Wrap Up<br />Get-Help about_Modules<br />http://www.simple-talk.com/sysadmin/powershell/an-introduction-to-powershell-modu...
Upcoming SlideShare
Loading in …5
×

An Introduction to PowerShell Modules

2,784 views

Published on

An Introduction to PowerShell Modules

Published in: Technology, Art & Photos
  • Be the first to comment

An Introduction to PowerShell Modules

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

×