CmdID

CmdID / PowerShell / Cmdlets / Remove

Remove-CimSession

Removes one or more CIM sessions. PowerShell reference

From the PowerShell reference 7 parameters Alias rcms

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

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

Remove-CimSession [-CimSession] <CimSession[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CimSession [-ComputerName] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CimSession [-Id] <UInt32[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CimSession -InstanceId <Guid[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CimSession -Name <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Remove all the CIM sessions

Get-CimSession | Remove-CimSessionIdentify

Remove a specific CIM session

Remove-CimSession -Id 5Identify

Show the list of CIM sessions to remove by using the WhatIf parameter

Remove-CimSession -Name a* -WhatIfIdentify

Its page in the reference: Remove-CimSession.

Parameters

7 in the PowerShell reference
-CimSessionSpecifies 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.
-ComputerNameSpecifies 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.
-IdSpecifies 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.
-InstanceIdSpecifies 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.
-NameSpecifies the friendly name of the CIM session to remove. You can use wildcard characters with this parameter.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.