다음을 통해 공유


Remove-PSSnapin

Removes Windows PowerShell snap-ins from the current session.

구문

Default (기본값)

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

Description

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 You cannot use this cmdlet to remove the snap-ins that are installed with Windows PowerShell.

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

예제

Example 1: Remove a snap-in

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: Remove snap-ins by using names with the pipeline

Get-PSSnapin smp* | Remove-PSSnapin

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

The command uses the Get-PSSnapin cmdlet to get objects that represent 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: Remove snap-ins by using names

Remove-PSSnapin -Name *event*

This command removes all Windows PowerShell snap-ins that have names that include event.

매개 변수

-Confirm

Prompts you for confirmation before running the cmdlet.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:cf

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Name

Specifies the names of Windows PowerShell snap-ins to remove from the current session. Wildcard characters (*) are permitted.

매개 변수 속성

형식:

String[]

Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:0
필수:True
파이프라인의 값:False
속성 이름별 파이프라인의 값:True
나머지 인수의 값:False

-PassThru

Returns an object that represents the snap-in. By default, this cmdlet does not generate any output.

매개 변수 속성

형식:SwitchParameter
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:wi

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

입력

PSSnapInInfo

You can pipe a snap-in object to this cmdlet.

출력

None, System.Management.Automation.PSSnapInInfo

This cmdlet generates a System.Management.Automation.PSSnapInInfo object that represents the snap-in, if you specify the PassThru parameter. By default, Remove-PSSnapin does not generate any output.

참고

Windows PowerShell includes the following aliases for Remove-PSSnapin:

  • rsnp

Remove-PSSnapin does not check the version of Windows PowerShell before removing a snap-in from the session. If a snap-in cannot be removed, a warning appears and the command fails.

Remove-PSSnapin affects only the current session. If you have added an Add-PSSnapin command to your Windows PowerShell profile, you should delete the command to remove the snap-in from future sessions. For instructions, type Get-Help about_Profiles.