This repository was archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
How to for installing for PowerShell
Alec Clews edited this page Aug 6, 2019
·
3 revisions
Note: This information is draft.
-
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= $([url]]"http://localhost:9191/rpc/api/xmlrpc")
try {
$r = Invoke-XmlRpcRequest -ServerUri $appServer -MethodName "api.getConfigValue" -Params $('herbert', "auth.webservices.auth-token")
if ($r.faultCode -and $r.faultstring ) {
Write-Error -message $r.faultstring
throw $r.faultstring
}
}
https://docs.microsoft.com/en-us/powershell/module/packagemanagement/?view=powershell-6
https://stackoverflow.com/questions/3079346/how-to-reference-net-assemblies-using-powershell
https://www.red-gate.com/simple-talk/sysadmin/powershell/managing-packages-using-windows-powershell/
Note from @Joffcom
Add-Type -Path "$dllPath\ServerCommandProxy.dll"
Add-Type -Path "$dllPath\CookComputing.XmlRpcV2.dll"
$api = New-Object PaperCut.ServerCommandProxy($papercutHost, $papercutPort, $authToken);
# Get user count
$userCount = $api.getTotalUsers()