Creating a custom PowerShell Snap-In

As we've seen in the Creating a custom PowerShell command (CmdLet) recipe, the creation of PowerShell CmdLet is a process of defining the functionality you want to expose to the user, and sealing it as a .NET assembly. In this recipe, we'll take a look at how you install your custom CmdLet which directly involves the creation of a PowerShell Snap-In.

We have already used the PowerShell Snap-In when we referenced a set of SharePoint Set earlier in this chapter. In this case, we called the following command:


Add-PSSnapin "Microsoft.SharePoint.Powershell"

In this example, we'll use similar approach to call our custom Snap-In.

Getting ready

As trivial as it sounds, to create a Snap-In, you will need to create another ...

Get Microsoft SharePoint 2010 Developer Compendium now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.