mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-07-26 07:58:14 +00:00
bc71ed4a12
ExecuteGuestCommand JSON-serialized the args array into the agent/exec 'input-data' field — which is the process's STDIN, not its arguments. So guest commands ran with no argv: cmd.exe started interactively and the JSON blob ['/c','echo',...] arrived at its prompt. PVE's agent/exec 'command' parameter is itself an array (element 0 = the executable, the rest = argv) sent as repeated form keys. The low-level client couldn't express repeated keys (Dictionary<string,string> only), so: - Add PostAsync(string, IEnumerable<KeyValuePair<string,string>>) to IPveHttpClient/PveHttpClient; BuildFormContent now emits one key=value field per pair, so a key may repeat. - ExecuteGuestCommand builds command = [exe] + args as repeated 'command' fields and no longer touches input-data. Tests: form-encoder repeated-key + per-value encoding cases; VmService tests asserting the command array, order, and absence of input-data; an integration regression guard that echoes an arg and checks it round-trips as stdout. Tracked as F091. Closes #68. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>