Gets the Windows PowerShell snap-ins on the computer.
Syntax
Copy Code | |
---|---|
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.
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.
Required? |
false |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-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.
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This command supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, OutBuffer, OutVariable, WarningAction, and WarningVariable. For more information, see about_CommonParameters.
Inputs and Outputs
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.
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
You can refer to Get-PSSnapin by its built-in alias, "psnp". For more information, see about_Aliases.
Example 1
Copy Code | |
---|---|
C:\PS>get-PSSnapIn |
Description
-----------
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
Copy Code | |
---|---|
C:\PS>get-PSSnapIn -registered |
Description
-----------
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
Copy Code | |
---|---|
C:\PS>get-PSSnapIn smp* |
Description
-----------
This command gets the Windows PowerShell snap-ins in the current session that have names that begin with "smp".