Remove-CimSession
Removes one or more CIM sessions.
구문
CimSessionSet (기본값)
Remove-CimSession
[-CimSession] <CimSession[]>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ComputerNameSet
Remove-CimSession
[-ComputerName] <String[]>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SessionIdSet
Remove-CimSession
[-Id] <UInt32[]>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
InstanceIdSet
Remove-CimSession
-InstanceId <Guid[]>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NameSet
Remove-CimSession
-Name <String[]>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-CimSession
cmdlet removes one or more CIM session objects from the local PowerShell
session.
예제
Example 1: Remove all the CIM sessions
This example retrieves all the available CIM sessions on the local computer using the
Get-CimSession cmdlet, and then removes them using the Remove-CimSession
.
Get-CimSession | Remove-CimSession
Example 2: Remove a specific CIM session
This example removes the CIM session that has an Id value of 5.
Remove-CimSession -Id 5
Example 3: Show the list of CIM sessions to remove by using the WhatIf parameter
This example uses the common parameter WhatIf to specify that the removal should not be done, but only output what would happen if it were done.
Remove-CimSession -Name a* -WhatIf
매개 변수
-CimSession
Specifies the session objects of the CIM sessions to close.
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.
매개 변수 속성
형식: | |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
CimSessionSet
Position: | 0 |
필수: | True |
파이프라인의 값: | True |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-ComputerName
Specifies an array of names of computers. Removes the sessions that connect to the specified computers. You can specify a fully qualified ___domain name (FQDN) or a NetBIOS name.
매개 변수 속성
형식: | String[] |
Default value: | None |
와일드카드 지원: | True |
DontShow: | False |
별칭: | CN, ServerName |
매개 변수 집합
ComputerNameSet
Position: | 0 |
필수: | True |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
매개 변수 속성
형식: | SwitchParameter |
Default value: | False |
와일드카드 지원: | False |
DontShow: | False |
별칭: | cf |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-Id
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 PowerShell session.
For more information about the range operator, see about_Operators.
매개 변수 속성
형식: | UInt32[] |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
SessionIdSet
Position: | 0 |
필수: | True |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-InstanceId
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 PowerShell.
The InstanceId is stored in the InstanceId property of the object that represents a CIM session.
매개 변수 속성
형식: | Guid[] |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
InstanceIdSet
Position: | Named |
필수: | True |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-Name
Specifies the friendly name of the CIM session to remove. You can use wildcard characters with this parameter.
매개 변수 속성
형식: | String[] |
Default value: | None |
와일드카드 지원: | True |
DontShow: | False |
매개 변수 집합
NameSet
Position: | Named |
필수: | True |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | 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.
입력
None
You can't pipe objects to this cmdlet.
출력
Object
This cmdlet returns an object that contains CIM session information.