Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Get-PSSnapin

Updated: October 17, 2013

Applies To: Windows PowerShell 4.0

Get-PSSnapin

Gets the Windows PowerShell snap-ins on the computer.

Aliases

The following abbreviations are aliases for this cmdlet:

  • gsnp

Syntax

Parameter Set: Default
Get-PSSnapin [[-Name] <String[]> ] [-Registered] [ <CommonParameters>]




Detailed Description

The Get-PSSnapin cmdlet gets the Windows PowerShell snap-ins that have been added to the current session or that have been registered on the system. The snap-ins are listed in the order in which they are detected.

Get-PSSnapin gets only registered snap-ins. To register a Windows PowerShell snap-in, use the InstallUtil tool included with the Microsoft .NET Framework 2.0. For more information, see "How to Register Cmdlets, Providers, and Host Applications" in the MSDN (Microsoft Developer Network) library at http://go.microsoft.com/fwlink/?LinkId=143619.

Beginning in Windows PowerShell 3.0, the core commands that are included in Windows PowerShell are packaged in modules. The exception is Microsoft.PowerShell.Core, which is a snap-in (PSSnapin). Only the Microsoft.PowerShell.Core snap-in is added to the session by default. Modules are imported automatically on first use and you can use the Import-Module cmdlet to import them.

Parameters

-Name<String[]>

Gets only the specified Windows PowerShell snap-ins. Enter the names of one or more Windows PowerShell snap-ins. Wildcards are permitted.

The parameter name ("Name") is optional.


Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

true

-Registered

Gets the Windows PowerShell snap-ins that have been registered on the system (even if they have not yet been added to the session).

The snap-ins that are installed with Windows PowerShell do not appear in this list.

Without this parameter, Get-PSSnapin gets the Windows PowerShell snap-ins that have been added to the session.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

    You cannot pipe input to Get-PSSnapin.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.Management.Automation.PSSnapInInfo

    Get-PSSnapin returns an object for each snap-in that it gets.


Notes

  • Beginning in Windows PowerShell 3.0, the core commands that are installed with Windows PowerShell are packaged in modules. In Windows PowerShell 2.0, and in host programs that create older-style sessions in later versions of Windows PowerShell, the core commands are packaged in snap-ins ("PSSnapins"). The exception is Microsoft.PowerShell.Core, which is always a snap-in. Also, remote sessions, such as those started by the New-PSSession cmdlet, are older-style sessions that include core snap-ins.

    For information about the CreateDefault2 method that creates newer-style sessions with core modules, see "CreateDefault2 Method" in MSDN at http://msdn.microsoft.com/en-us/library/windows/desktop/system.management.automation.runspaces.initialsessionstate.createdefault2(v=VS.85).aspx.

Examples

-------------------------- EXAMPLE 1 --------------------------

This command gets the Windows PowerShell snap-ins that are currently loaded in the session. This includes the snap-ins that are installed with Windows PowerShell and those that have been added to the session.


PS C:\> get-PSSnapIn

-------------------------- EXAMPLE 2 --------------------------

This command gets the Windows PowerShell snap-ins that have been registered on the computer, including those that have already been added to the session. The output does not include snap-ins that are installed with Windows PowerShell or Windows PowerShell snap-in dynamic-link libraries (DLLs) that have not yet been registered on the system.


PS C:\> get-PSSnapIn -registered

-------------------------- EXAMPLE 3 --------------------------

This command gets the Windows PowerShell snap-ins in the current session that have names that begin with "smp".


PS C:\> get-PSSnapIn smp*

Related topics



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.