Listing All Available PowerShell Snapins

This is a very useful tip for anybody wanting to mess around with Powershell and discover new ways of automating their work. By default, any Powershell session you open will automatically ​load the Microsoft.PowerShell.Core snapin. This snapin includes most of common core cmdlets to allow users to quickly get started with their scripts. The method we’re interested in is the Get-PSSnapin cmdlet, which returns a list of available cmdlets. If you were to execute this cmdlet and not pass it any parameters, it will automatically list all the Snapins that are currently loaded in the session. (See Figure 1)

20140717-1.png

Figure 1 – Listing all loaded PowerShell Snapins

Now, if we wish to get a list of all Snapins that are available to us, we can simply add the -Registered parameter (see Figure 2). This will automatically list all snapins that you can use in your session. You can load a new snapin in your current session by using the Add-PSSnapin <name of snapin> command.

20140717-2.png

Figure 2 – Listing all registered PowerShell Snapins

Enjoy!

Microsoft Premier Field Engineer - SharePoint

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*