# Disconnect-IntelligenceX

Disconnects the active IntelligenceX client and clears local session context.

Command 

**Module**

`IntelligenceX.PowerShell`

**Inputs**

`IntelligenceX.OpenAI.IntelligenceXClient`

Disconnects the active IntelligenceX client and clears local session context.

## Syntax

```
Disconnect-IntelligenceX
[-Client <IntelligenceXClient>]
[<CommonParameters>]
```

[#](#method-disconnect-intelligencex-intelligencexclient)

## Examples

### Example 1

```powershell
Disconnect-IntelligenceX
```

Disconnect the active client

### Example 2

```powershell
Disconnect-IntelligenceX -Client $client
```

Disconnect a specific client object

### Example 3

```powershell
try { Invoke-IntelligenceXChat -Text "Summarize changes" } finally { Disconnect-IntelligenceX }
```

Clean up at the end of a script

## Parameters

**-Client IntelligenceXClient optionalpipeline: true (ByValue)**

Client instance to disconnect. Defaults to the active client.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:2473B41DAC28C87991076A3E59CC260F22D55287725687C3C4D1F151A7B2E80D -->
