Adds one or more Windows PowerShell snap-ins to the current session. (Add-PSSnapin)



Adds one or more Windows PowerShell snap-ins to the current session.

Add-PSSnapin [-Name] <string[]> [-PassThru] [<CommonParameters>]

The Add-PSSnapin cmdlet adds registered Windows PowerShell snap-ins to the current session. After the snap-ins are added, you can use the cmdlets and providers that the snap-ins support in the current session.

To add the snap-in to all future Windows PowerShell sessions, add an Add-PSSnapin command to your Windows PowerShell profile. For more information, see about_Profiles.

-Name <string[]>
Specifies the name of the snap-in. (This is the Name, not the AssemblyName or ModuleName.)

To find the names of the registered snap-ins on your system, type: "get-pssnapin -registered".

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-PassThru [<SwitchParameter>]
Returns an object representing each added snap-in. By default, this cmdlet does not generate any output.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

You cannot pipe objects to Add-PSSnapin.

None or System.Management.Automation.PSSnapInInfo
When you use the PassThru parameter, Add-PSSnapin returns a PSSnapInInfo object that represents the snap-in. Otherwise, this cmdlet does not generate any output.


For detailed information about snap-ins in Windows PowerShell, see about_PSSnapins. For information about how to create a Windows PowerShell snap-in, see "How to Create a Windows PowerShell Snap-in" in the MSDN (Microsoft Developer Network) library at

Add-PSSnapin adds the snap-in only to the current session. To add the snap-in to all Windows PowerShell sessions, add it to your Windows PowerShell profile. For more information, see about_Profiles.

You can add any Windows PowerShell snap-in that has been registered by using the Microsoft .NET Framework install utility. For more information, see "How to Register Cmdlets, Providers, and Host Applications" in the MSDN library at

To get a list of snap-ins that are registered on your computer, type "get-pssnapin -registered".

Before adding a snap-in, Add-PSSnapin checks the version of the snap-in to verify that it is compatible with the current version of Windows PowerShell. If the snap-in fails the version check, Windows PowerShell reports an error.


C:\PS>add-PSSnapIn Microsoft.Exchange, Microsoft.Windows.AD

# Description
This command adds the Microsoft Exchange and Active Directory snap-ins to the current session.


C:\PS>get-pssnapin -registered | add-pssnapin -passthru

# Description
This command adds all of the registered Windows PowerShell snap-ins to the session. It uses the Get-PSSnapin cmdlet with the Registered parameter to get objects representing each of the registered snap-ins. The pipeline operator (|) passes the result to Add-PSSnapin, which adds them to the session. The PassThru parameter returns objects that represent each of the added snap-ins.



# Description
This example demonstrates the process of registering a snap-in on your system and then adding it to your session. It uses ManagementFeatures, a fictitious snap-in implemented in a file called ManagementCmdlets.dll.

The first command gets snap-ins that have been added to the current session, including the snap-ins that are installed with Windows PowerShell. In this example, ManagementFeatures is not returned. This indicates that it has not been added to the session.


The second command gets snap-ins that have been registered on your system (including those that have already been added to the session). It does not include the snap-ins that are installed with Windows PowerShell.

get-pssnapin -registered

In this case, the command does not return any snap-ins. This indicates that the ManagementFeatures snapin has not been registered on the system.

The third command creates an alias, "installutil", for the path to the InstallUtil tool in the .NET Framework.

set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe

The fourth command uses the InstallUtil tool to register the snap-in. The command specifies the path to ManagementCmdlets.dll, the file name or "module name" of the snap-in.

installutil C:\Dev\Management\ManagementCmdlets.dll

The fifth command is the same as the second command. This time, you use it to verify that the ManagementCmdlets snap-in is registered.

get-pssnapin -registered

The sixth command uses the Add-PSSnapin cmdlet to add the ManagementFeatures snap-in to the session. It specifies the name of the snap-in, ManagementFeatures, not the file name.

add-pssnapin ManagementFeatures

To verify that the snap-in is added to the session, the seventh command uses the Module parameter of the Get-Command cmdlet. It displays the items that were added to the session by a snap-in or module.

get-command -module ManagementFeatures

You can also use the PSSnapin property of the object that Get-Command returns to find the snap-in or module in which a cmdlet originated. The eighth command uses dot notation to find the value of the PSSnapin property of the Set-Alias command.

(get-command set-alias).pssnapin

Online version:

C:\Windows>powershell get-help Remove-PSSnapin -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.

OS: Windows-7 / Windows-Vista // Windows Server 2008
»»»» ColorConsole


... Home  
... Impressum
... ColorConsole

... CMD
... Netsh-XP
... Netsh-7
... Netsh-Vista
... Powershell

Download the Windows 7 Starter, Home (Basic Premium), Professional und Ultimate!

Problem, PDF preview does not work for me with Q-Dir 4.15 x64?  / Windows 7 Service Pack 1 downloaden, wo finde ich die Adresse?  / Was sind Variablen?  / Wo kann ich in Windows-10 Downloaden?  / Kann ich die Desktop Icons, bzw. das Symbollayout auch bei Windows-7 speichern?  / Quick dock and compare the windows under Windows 8.1 / 10!  / Habe ein Problem mit der Pinnwand, meine Freunde habe ich blockiert, wie kann ich diese wieder für meine Pinnwand freischalten?  / Enable screen saver password in Windows 10, how to turn off?  / Freigegebene Ordner und Festplatten in Windows-7 ändern, hinzufügen, entfernen!  / Office 2003 installiert, alles funktioniert in Win-7, aber Outlook 2003 nicht?  / Kann man in Windows 8.1/10 das automatische Ausklappen des Verzeichnisbaumes in MS-Explorer deaktivieren?  / My Magazin vom Start (Homescreen) am Android Handy entfernen!  /