curl -kLi -H "Content-Type: text/xml" -H "HTTP_AUTH_LOGIN: admin" -H "HTTP_AUTH_PASSWD:verysecurepwd" -H "HTTP_PRETTY_PRINT: TRUE" -d @payload.xml https://plesk.example.com:8443/enterprise/control/agent.php
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $request = New-Object System.Net.WebClient $request.Headers.add('HTTP_AUTH_LOGIN','admin') $request.Headers.add('HTTP_AUTH_PASSWD','verysecurepwd') $request.Headers.add('HTTP_PRETTY_PRINT','true') $response = $request.UploadFile('https://plesk.example.com:8443/enterprise/control/agent.php','.\payload.xml') [System.Text.Encoding]::ASCII.GetString($response)