Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows PowerShell for .NET Developers - Second Edition

You're reading from   Windows PowerShell for .NET Developers - Second Edition Efficiently administer and maintain your development environment with Windows PowerShell

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781785287435
Length 330 pages
Edition 2nd Edition
Arrow right icon
Toc

Understanding PowerShell modules

Windows PowerShell modules present a simple way to organize and package our script so as to make it distributable and reusable.

In this section, we will cover the following topics:

  • What is a module?
  • Script modules
  • Binary modules
  • Manifest modules
  • Dynamic modules

Introduction to modules

Windows PowerShell can be created dynamically or persisted to our disk. While discussing PowerShell modules, for a moment I thought about the old-style snap-ins in PowerShell version 1.0, which still exist. Yeah! SharePoint still has snap-ins and not modules.

Snap-ins only contain cmdlets and providers, whereas in modules, we can have functions, variables, aliases, and PowerShell drives.

Before we create a module, we need to know what a module should deliver and where it should be placed. Use this code to find the module path:

$env:PSModulePath -split ';'

You will see two different paths, where one is the system location and the other is the user profile location, as follows...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image