Table of contents
TOC
Collapse the table of content
Expand the table of content

Get-PSSnapin

JuanPablo Jofre|Last Updated: 11/17/2016
|
2 Contributors

SYNOPSIS

Gets the Windows PowerShell snap-ins on the computer.

SYNTAX

Get-PSSnapin [[-Name] <String[]>] [-Registered] [<CommonParameters>]

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.

EXAMPLES

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

PS C:\>get-PSSnapIn

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.

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

PS C:\>get-PSSnapIn -registered

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.

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

PS C:\>get-PSSnapIn smp*

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

PARAMETERS

-Name

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.

Type: String[]
Parameter Sets: (All)
Aliases: 

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.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

None

You cannot pipe input to Get-PSSnapin.

OUTPUTS

System.Management.Automation.PSSnapInInfo

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

NOTES

Add-PSSnapin

Remove-PSSnapin

© 2016 Microsoft