SlideShare a Scribd company logo
An Introduction to PowerShell  Modules Jonathan Medd
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
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
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
Modules can transform you from this:
To Superstars with Groupies:
More on the module that made that transformation happen later........
Buy This Book
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
Demo – Create a Module
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
Demo – Create The Manifest
Modules Make Distributing Your Code Easier VS
Demo – PowerCLIBook Module
Other Modules Windows Server2008 R2  -> Community Modules PowerShell Community Extensions BSonPOSH Module SQLPSX Search on http://www.codeplex.com – currently 50+
Demo – TroubleShootingPack Module
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

More Related Content

Similar to An Introduction to PowerShell Modules

Save Time With PowerCLI
Save Time With PowerCLISave Time With PowerCLI
Save Time With PowerCLI
jonathanmedd
 
PowerCLI in the Enterprise Breaking the Magicians Code original
PowerCLI in the Enterprise Breaking the Magicians Code   originalPowerCLI in the Enterprise Breaking the Magicians Code   original
PowerCLI in the Enterprise Breaking the Magicians Code original
jonathanmedd
 
Puppet
PuppetPuppet
Node Session - 2
Node Session - 2Node Session - 2
Node Session - 2
Bhavin Shah
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
Concentrated Technology
 
Features & Installation Profiles
Features & Installation ProfilesFeatures & Installation Profiles
Features & Installation Profiles
David Watson
 
NodeJs Session02
NodeJs Session02NodeJs Session02
NodeJs Session02
Jainul Musani
 
Everything you need to know about PowerShell
Everything you need to know about PowerShellEverything you need to know about PowerShell
Everything you need to know about PowerShell
Shane Hoey
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
Paul Withers
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
European Collaboration Summit
 
Features everywhere
Features everywhere Features everywhere
Features everywhere
Mediacurrent
 
Recipes for Drupal distributions
Recipes for Drupal distributionsRecipes for Drupal distributions
Recipes for Drupal distributions
Lakshmi Narasimhan Parthasarathy
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
Lambert Beekhuis
 
Developing sites with Magnolia 4 / STK
Developing sites with Magnolia 4 / STKDeveloping sites with Magnolia 4 / STK
Developing sites with Magnolia 4 / STK
guest0afb3
 
Using Features
Using FeaturesUsing Features
Using Features
Alexandru Badiu
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
Concentrated Technology
 
Frankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGiFrankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGi
Toni Epple
 
JavaScript Module Loaders
JavaScript Module LoadersJavaScript Module Loaders
JavaScript Module Loaders
zeroproductionincidents
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
Justin J. Moses
 

Similar to An Introduction to PowerShell Modules (20)

Save Time With PowerCLI
Save Time With PowerCLISave Time With PowerCLI
Save Time With PowerCLI
 
PowerCLI in the Enterprise Breaking the Magicians Code original
PowerCLI in the Enterprise Breaking the Magicians Code   originalPowerCLI in the Enterprise Breaking the Magicians Code   original
PowerCLI in the Enterprise Breaking the Magicians Code original
 
Puppet
PuppetPuppet
Puppet
 
Node Session - 2
Node Session - 2Node Session - 2
Node Session - 2
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
 
Features & Installation Profiles
Features & Installation ProfilesFeatures & Installation Profiles
Features & Installation Profiles
 
NodeJs Session02
NodeJs Session02NodeJs Session02
NodeJs Session02
 
Everything you need to know about PowerShell
Everything you need to know about PowerShellEverything you need to know about PowerShell
Everything you need to know about PowerShell
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
 
Features everywhere
Features everywhere Features everywhere
Features everywhere
 
Recipes for Drupal distributions
Recipes for Drupal distributionsRecipes for Drupal distributions
Recipes for Drupal distributions
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
Developing sites with Magnolia 4 / STK
Developing sites with Magnolia 4 / STKDeveloping sites with Magnolia 4 / STK
Developing sites with Magnolia 4 / STK
 
Using Features
Using FeaturesUsing Features
Using Features
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
 
Frankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGiFrankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGi
 
JavaScript Module Loaders
JavaScript Module LoadersJavaScript Module Loaders
JavaScript Module Loaders
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
 

Recently uploaded

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

An Introduction to PowerShell Modules

  • 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........
  • 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
  • 15. Other Modules Windows Server2008 R2 -> Community Modules PowerShell Community Extensions BSonPOSH Module SQLPSX Search on http://www.codeplex.com – currently 50+
  • 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