winrm_execute_powershell
Execute PowerShell commands on Windows hosts over WinRM and return stdout, stderr, and exit code; supports timeouts, environment variables, working directories, and JSON output.
Instructions
Execute PowerShell over WinRM and return stdout, stderr (error/warning/verbose streams) and the exit code, including exit N. On timeout the remote command is stopped. output_format='json' converts the output objects with ConvertTo-Json and returns them parsed in data.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "winrm_execute_powershell"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| env | No | ||
| command | Yes | ||
| timeout | No | ||
| connection | No | ||
| saved_host | No | ||
| output_limit | No | ||
| output_format | No | text | |
| inventory_scope | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||