Powershell Tutorial Online

Powershell Snapins

What is snapin?
PowerShell two main ways to add or extend the shell:
Snap-Ins – Are compiled cmdlets in to a DLL written in a .Net language are bening deprecated and no longer recomended as the way to create and package new cmdlets.
Modules – A package that contains Windows PowerShell commands int he form of functions, cmdlerts and worksflows, in addition it may contain variables, aliases and providers. Modules can be written in PowerShell and/or compiled as DLLs.
Here we will try to get existing registered modules in shell.
Get-Module -ListAvailable

Modules have primarily 2 locations on your system
Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules Directory: C:\Users\XXX\Documents\WindowsPowerShell\Modules;
Profile location is needed for load default modules in shell, as once we close the PS session all registered get every time.
to load these registered modules we can create own profile.
We will see why profile location needed in later half
Directory: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules
I have registered modules here SqlServerCmdletSnapin100, WDeploySnapin3.0

Get-PSSnapin -registered

Lets check what are the sanpin I have regitered on my machine.
I have regitered Web Deployment infrastructure PowerShell snap-in that contains cmdlets for managing Microsoft Web Deployment infrastructure.
Registration can be done by using Add-PSSnapin command
        Add-PSSnapin WDeploySnapin3.0

Once you add that you seek for help for these command and it works as any other microsoft commands.

There is way to review what's in the Power Tools and to get the full list of cmdlets installed by the TFS Power Tools is to use:

        add-pssnapin Microsoft.TeamFoundation.PowerShell

One of the nice things is that raw TFS API objects are being returned, and the snap-ins define custom Windows PowerShell formatting rules for these objects.