PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Remove-PSSnapin', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Removes Windows PowerShell snap-ins from the current session.


Remove-PSSnapin [-Name] <String[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]

Search powershellhelp.space


The Remove-PSSnapin cmdlet removes a Windows PowerShell snap-in from the current session. You can use it to remove snap-ins that you have added to Windows PowerShell, but
you cannot use it to remove the snap-ins that are installed with Windows PowerShell.

After a snap-in is removed from the current session, it is still loaded, but the cmdlets and providers in the snap-in are no longer available in the session.



Online Version: http://go.microsoft.com/fwlink/p/?linkid=289609




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

PS C:\>remove-pssnapin -name Microsoft.Exchange

This command removes the Microsoft.Exchange snap-in from the current session. When the command is complete, the cmdlets and providers that the snap-in supported are not
available in the session.

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

PS C:\>get-PSSnapIn smp* | remove-PSSnapIn

This command removes the Windows PowerShell snap-ins that have names beginning with "smp" from the current session.

The command uses the Get-PSSnapin cmdlet to get objects representing the snap-ins. The pipeline operator (|) sends the results to the Remove-PSSnapin cmdlet, which removes
them from the session. The providers and cmdlets that this snap-in supports are no longer available in the session.

When you pipe objects to Remove-PSSnapin, the names of the objects are associated with the Name parameter, which accepts objects from the pipeline that have a Name property.

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

PS C:\>remove-pssnapin -name *event*

This command removes all Windows PowerShell snap-ins that have names that include "event". This command specifies the "Name" parameter name, but the parameter name can be
omitted because it is optional.