Get-PSSnapin

List PowerShell snap-ins on this computer.

Syntax
      Get-PSSnapin [[-name] string[]] [-registered] [CommonParameters]

Key
   -name
       The PowerShell snap-in(s). Wildcards are permitted.
        
   -registered 
       Get only the PowerShell snap-ins that have been registered on 
       the system. The snap-ins that are installed with Windows PowerShell do 
       not appear in this list.

PowerShell contains a default set of snap-ins containing the built-in providers and cmdlets.

In PowerShell 2.0 these default Snap-Ins are:

Microsoft.PowerShell.Core = Cmponents of PowerShell.
Microsoft.PowerShell.Host = Start-Transcript, Stop-Transcript etc, managing PowerShell console host.
Microsoft.PowerShell.Management = Management cmdlets used to manage Windows components.
Microsoft.PowerShell.Security = Cmdlets to manage Windows PowerShell security.
Microsoft.PowerShell.Utility = Utility Cmdlets used to manipulate data.
Microsoft.PowerShell.Diagnostics = Eventing and Performance Counter cmdlets.
Microsoft.WSMan.Management = Get-WSManInstance, Set-WSManInstance etc for WSMan operations.

Installing a Snap-In requires Administrator rights.

Beginning in PowerShell 2.0 Modules were introduced and they almost entirely replace Snap-Ins.
Snap-Ins are still available and fully supported. Snap-Ins have to be installed, modules can be copied and then made available with Import-Module

Equivalent commands for Snap-Ins and Modules are shown below:

Get-PSSnapIn -registered
Add-PSSnapIn name
Get-Command -pssnapin name

Get-Module -ListAvailable
Import-Module name
Get-Command -module name

Standard Aliases for Get-PSSnapin: None (gsnp removed from PowerShell 7).

Examples

Get the Windows PowerShell snap-ins that are currently loaded:

PS C:> get-PSSnapIn

Gets the PowerShell snap-ins registered on the computer:

PS C:> get-PSSnapIn * -registered

"A man's got to know his limitations" - Harry Callahan (Magnum Force)

Related PowerShell Cmdlets

Add-PSSnapIn - Add snap-ins to the console.
Get-Module - Get the modules imported to the session.
Remove-PSSnapin - Remove PowerShell snap-ins from the console.
Export-Console - Export console configuration to a file.


 
Copyright © 1999-2024 SS64.com
Some rights reserved