# Invoke-IntelligenceXCommand

Executes a command through the app-server.

Command 

**Module**

`IntelligenceX.PowerShell`

**Inputs**

`IntelligenceX.OpenAI.IntelligenceXClient`

**Outputs**

`IntelligenceX.Json.JsonValue` `IntelligenceX.OpenAI.AppServer.Models.CommandExecResult`

Executes a command through the app-server.

## Syntax

```
Invoke-IntelligenceXCommand
-Command <string[]>
[-Client <IntelligenceXClient>]
[-NetworkAccess]
[-Raw]
[-SandboxType <string>]
[-TimeoutMs <int>]
[-WorkingDirectory <string>]
[-WritableRoot <string[]>]
[<CommonParameters>]
```

[#](#method-invoke-intelligencexcommand-string-intelligencexclient-switchparameter-switchparameter-string-int-string-string)

## Examples

### Example 1

```powershell
Invoke-IntelligenceXCommand -Command @("git","status") -WorkingDirectory "C:\repo"
```

Run a command in the repository root

### Example 2

```powershell
Invoke-IntelligenceXCommand -Command @("dotnet","test") -SandboxType "workspace" -WorkingDirectory "C:\repo"
```

Run a command in a sandboxed workspace

### Example 3

```powershell
Invoke-IntelligenceXCommand -Command @("git","status") -TimeoutMs 5000
```

Run a command with a timeout

## Parameters

**-Command string[] required**

Command and arguments.

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

Client instance to use. Defaults to the active client.

**-NetworkAccess SwitchParameter optional**

Enable network access for sandboxed runs.

**-Raw SwitchParameter optional**

Return raw JSON response.

**-SandboxType string optional**

Sandbox type for execution.

**-TimeoutMs int optional**

Command timeout in milliseconds.

**-WorkingDirectory string optional**

Working directory for the command.

**-WritableRoot string[] optional**

Writable root paths for sandboxed runs.

## 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:50516B112070638D0229BDF7971747305F800CF59F12D853E7E91F9E2ABA2644 -->
