Using Snap-Ins

Snap-ins are used to show a list of all the registered PSSnapins outside of the default snap-ins that come with PowerShell. Entering the command Get-PSSnapin -Registered on a newly installed PowerShell system will return nothing, as shown in the following example:

PS C:\> get-pssnapin -registered

In most cases, a setup program will accompany a PowerShell snap-in and ensure that it becomes correctly registered for use. However, if this is not the case, the .NET utility InstallUtil.exe is used to complete the registration process. In the following example, InstallUtil.exe is being used to install a third-party library file called freshtastic-automation.dll:

PS C:\> & "$env:windir\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" ...

Get Windows Server® 2012 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.