Hi,
I-m trying to copy the content of script through the Proxmox guest agent to a windows client in Powershell. However, when I have a curly brackets "{" in the script the file-write will fail with the error {}":"property is not defined in schema and the schema does not allow additional properties because it is probably interpreted as Json. how do I "whitelist" these characters for the write-file.
I'm accessing the API via Powershells Invoke-RestMethod. (powershell is the only option we have so we can't change to a different languages or to pvesh)
the two curly Brackets at the end throw the error. If i remove only that part of the script it works.
thanks in advance
I-m trying to copy the content of script through the Proxmox guest agent to a windows client in Powershell. However, when I have a curly brackets "{" in the script the file-write will fail with the error {}":"property is not defined in schema and the schema does not allow additional properties because it is probably interpreted as Json. how do I "whitelist" these characters for the write-file.
I'm accessing the API via Powershells Invoke-RestMethod. (powershell is the only option we have so we can't change to a different languages or to pvesh)
Code:
$source = " ....some code... & {$var}"
$destination= "C:\Users\user\Desktop\script.ps1"
Invoke-RestMethod -Uri ("https://$ip:8006/api2/json/nodes/pvetest/qemu/101/agent/file-write?content=$source&file=$destination") -Method Post -SkipCertificateCheck -Headers $headers
the two curly Brackets at the end throw the error. If i remove only that part of the script it works.
thanks in advance