locked
Calling XML-RPCMethod from powershell with API's RRS feed

  • Question

  • HI,

    I am trying to get data using XML-RPCMethod from powershell,

    As of now, I have tried like follows,

    Clear-Host
    add-type @"
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
    ServicePoint srvPoint, X509Certificate certificate,
    WebRequest request, int certificateProblem) {
    return true;
    }
    }
    "@
    [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy 
    Import-Module RPC-Client
    $method = 'auth.login'
    $params = @(1,'username','password')
    $body = New-RPCMethod -MethodName $method -Params $params
    Invoke-RPCMethod -RpcServerUri "https://xyz/rpc/api" -RequestBody $body

    Am not getting any output from the above script

    Please let me know where I am doing wrong.

    TIA

    Friday, June 3, 2016 12:57 PM

Answers

All replies