Answered by:
Calling XML-RPCMethod from powershell with API's

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
- Moved by Dave PatrickMVP Friday, June 3, 2016 1:38 PM
Friday, June 3, 2016 12:57 PM
Answers
-
Hello,
I'd probably ask in the Windows PowerShell forum.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})- Proposed as answer by Noel D PatonEditor Saturday, June 4, 2016 8:08 AM
- Marked as answer by Just Karl Thursday, June 16, 2016 9:07 PM
Friday, June 3, 2016 1:40 PM -
Might try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Noel D PatonEditor Saturday, June 4, 2016 8:08 AM
- Marked as answer by Just Karl Thursday, June 16, 2016 9:07 PM
Friday, June 3, 2016 1:47 PM
All replies
-
Hello,
I'd probably ask in the Windows PowerShell forum.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})- Proposed as answer by Noel D PatonEditor Saturday, June 4, 2016 8:08 AM
- Marked as answer by Just Karl Thursday, June 16, 2016 9:07 PM
Friday, June 3, 2016 1:40 PM -
Might try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Noel D PatonEditor Saturday, June 4, 2016 8:08 AM
- Marked as answer by Just Karl Thursday, June 16, 2016 9:07 PM
Friday, June 3, 2016 1:47 PM