Skip to content

New-PveNodesQemuAgentExec

Executes the given command in the vm via the guest-agent and returns an object with the pid.

API: POST /nodes/{node}/qemu/{vmid}/agent/exec, Proxmox VE API viewer

New-PveNodesQemuAgentExec
[-PveTicket <PveTicket>]
-Command <array>
[-InputData <string>]
-Node <string>
-Vmid <int>
[<CommonParameters>]
Parameter Type Required Description
-PveTicket PveTicket No Ticket data connection.
-Command array Yes The command as a list of program + arguments.
-InputData string No Data to pass as ‘input-data’ to the guest. Usually treated as STDIN to ‘command’.
-Node string Yes The cluster node name.
-Vmid int Yes The (unique) ID of the VM.

Every parameter also binds by property name from the pipeline, so an object with node and vmid properties (the output of Get-PveGuest, for one) fills -Node and -Vmid. Without -PveTicket the cmdlet uses the last connection, see Connection.

A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.