Remove-CimSession

Remove-CimSession

Removes one or more CIM sessions.

구문

Parameter Set: CimSessionSet
Remove-CimSession [-CimSession] <CimSession[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ComputerNameSet
Remove-CimSession [-ComputerName] <String[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: InstanceIdSet
Remove-CimSession -InstanceId <Guid[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NameSet
Remove-CimSession -Name <String[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SessionIdSet
Remove-CimSession [-Id] <UInt32[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Remove-CimSession cmdlet removes one or more CIM session objects from the local Windows PowerShell® session.

매개 변수

-CimSession<CimSession[]>

Runs the command using the specified CIM session. Enter a variable that contains the CIM session, or a command that creates or gets the CIM session, such as the New-CimSession or Get-CimSession cmdlets. For more information, see about_CimSessions.

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

true (ByValue, ByPropertyName)

와일드카드 문자 허용 여부

false

-ComputerName<String[]>

Specifies the name of the computer on which you want to run the CIM operation. You can specify a fully qualified domain name (FQDN) or a NetBIOS name.

If you specify this parameter, the cmdlet creates a temporary session to the specified computer using the WsMan protocol.

If you do not specify this parameter, the cmdlet performs the operation on the local computer using Component Object Model (COM).

If multiple operations are being performed on the same computer, connecting using a CIM session gives better performance.

별칭

cn, ServerName

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Id<UInt32[]>

Specifies the ID of the CIM session to remove. Specify one or more IDs separated by commas, or use the range operator (..) to specify a range of IDs.

An ID is an integer that uniquely identifies the CIM session in the current Windows PowerShell session. It is easier to remember and type than InstanceId, but it is unique only within the current Windows PowerShell session.

For more information about the range operator, see about_Operators.

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-InstanceId<Guid[]>

Specifies the instance ID of the CIM session to remove.

InstanceID is a Globally Unique Identifier (GUID) that uniquely identifies a CIM session. The InstanceID is unique, even when you have multiple sessions running in Windows PowerShell.

The InstanceID is stored in the InstanceID property of the object that represents a CIM session.

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Name<String[]>

Specifies the friendly name of the CIM session to remove. You can use wildcard characters with this parameter.

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • None

    This cmdlet accepts no input objects.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • System.Object

    This cmdlet returns an object that contains CIM session information.

예제

Example 1: Remove all the CIM sessions

This command retrieves all the available CIM sessions on the local computer using the Get-CimSession cmdlet, and then removes them using the Remove-CimSession.

PS C:\> Get-CimSession | Remove-CimSession

Example 2: Remove a specific CIM session

This command removes the CIM session that has an ID value of 5.

PS C:\> Remove-CimSession -Id 5

Example 3: Show the list of CIM sessions to remove by using the WhatIf parameterby the parameter

This command uses the common parameter WhatIf to specify that the removal should not be done, but only output what would happen if it were done.

PS C:\> Remove-CimSession -Name a* -WhatIf

관련 항목

Get-CimSession

New-CimSession