How to for installing for PowerShell - PaperCutSoftware/web-services-api-dot-net-core GitHub Wiki
Powershell Binary lib installation information
This is the prefered approach
Follow the information at https://www.papercut.com/kb/Main/AdministeringPaperCutWithPowerShell
Pure Powershell XML-RPC library
Note: This information is draft and currently does not work because of limitations in the third party lib.
-
Download the PSXmlRpcClient module from here https://github.com/PaperCutSoftware/PSXmlRpcClient
-
You can then write some code like this
Import-Module .\PSXmlRpcClient\PSXmlRpcClient -Force
$appServer= $([uri]"http://localhost:9191/rpc/api/xmlrpc")
$auth="xtoken"
try {
$r = Invoke-XmlRpcRequest -ServerUri $appServer -MethodName "api.getConfigValue" -Params $($auth, "auth.webservices.auth-token")
if ($r.faultCode -and $r.faultstring ) {
throw $r.faultstring
}
}
catch { Write-Error -message $r.faultstring }
finally { Write-Host $r }