Skip to content

New-PveNodesQemuAgentFileWrite

Writes the given file via guest agent.

API: POST /nodes/{node}/qemu/{vmid}/agent/file-write, Proxmox VE API viewer

New-PveNodesQemuAgentFileWrite
[-PveTicket <PveTicket>]
-Content <string>
[-Encode <bool>]
-File <string>
-Node <string>
-Vmid <int>
[<CommonParameters>]
Parameter Type Required Description
-PveTicket PveTicket No Ticket data connection.
-Content string Yes The content to write into the file.
-Encode bool No If set, the content will be encoded as base64 (required by QEMU).Otherwise the content needs to be encoded beforehand - defaults to true.
-File string Yes The path to the file.
-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.