power_shell_exec
Send a PowerShell command to an open session and capture its output in one call. Avoid concurrent commands to keep results clean.
Instructions
Send a command to a PowerShell shell session and wait for the output. Combines write + delay + read in one call. IMPORTANT: Do NOT issue concurrent commands to the same session_id — the PowerShell process is a single channel; concurrent calls will interleave output and corrupt results. Always wait for the previous command to finish before sending the next one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Buffer clear flag: 1 (default) = clear buffer before collecting, 0 = append to buffer | |
| delay | No | Wait time in milliseconds before reading output (default: 1000) | |
| command | Yes | The PowerShell command to execute | |
| session_id | Yes | The session ID returned by power_shell_open |