Remove PowerShell snap-ins from the current console.

      Remove-PSSnapin [-name] string[] [-passThru]
              [-whatIf] [-confirm] [CommonParameters]

   -name string[]
       Name of each PowerShell snap-in to remove from the current console
       e.g. Microsoft.Exchange or MyCompany.User. 

       Pass the object created by this cmdlet through the pipeline.

       Describe what would happen if you executed the command without
       actually executing the command.
       Prompt for confirmation before executing the command.

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Standard Aliases for Remove-PSSnapin: rsnp

Changing the available cmdlets and providers by adding or removing snap-ins will only affect the current console, unless Export-Console is used to save the console. Built-in snap-ins that are installed with PowerShell cannnot be removed.


Remove the Micrsoft.Exchange snap-in from the current console:

PS C:> remove-pssnapinn -name Microsoft.Exchange

Remove all the PowerShell snap-ins that have names beginning with "smp" from the current session:

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

“All good things are wild and free” ~ Henry David Thoreau

Related PowerShell Commands:

add-PSSnapIn - Add snap-ins to the console
get-PSSnapin - List PowerShell snap-ins on this computer
Export-Console - Export console configuration to a file

Copyright © 1999-2019
Some rights reserved