Chapter 5. Working with PSSnapins and modules
This chapter covers
- Extending PowerShell functionality
- Using PSSnapins and modules
- Module discovery and automatic loading
PowerShell’s real value lies not in the hundreds of built-in commands that it ships with but in its ability to have more commands added. PowerShell extensions—our collective term for the PSSnapins and modules that can be loaded—permit PowerShell to manage anything: IIS, Exchange, SQL Server, VMware, Citrix, NetApp, SharePoint, Cisco, you name it. Being able to efficiently work with these extensions is probably one of the most important things you’ll do in the shell.
Before we jump into working with these extensions, let’s get something straight: There’s no such thing as a product-specific version of PowerShell. It’s easy to get the impression that such a thing exists, because Microsoft tends to create Start menu shortcuts with names like “Exchange Management Shell,” “SharePoint Management Shell,” and so forth.
Note
The PowerShell functionality in SQL Server 2008 and 2008 R2 is the only exception to this rule of which we know. It had its own version of PowerShell—sqlps.exe—that was a recompiled version of PowerShell with the SQL Server functionality added and the snap-in functionality removed. SQL Server 2012 delivers its PowerShell functionality as a module (confusingly called sqlps) so we’ll forget (and possibly even forgive) the oddity that was sqlps.exe.