Remove-PSSnapin

Remove PowerShell snap-ins from the current console.

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

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

   -passThru 
       Pass the object created by this cmdlet through the pipeline.

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

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.

Standard Aliases for Remove-PSSnapin: None (rsnp removed from PowerShell 7).

Examples

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 Cmdlets

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-2024 SS64.com
Some rights reserved