Body
To manage Papercut from Powershell you must build the ServerCommandProxy.dll. Papercut has directions to build it, but they are incomplete.
The Papercut directions can be found here:
Administering PaperCut with PowerShell | PaperCut
dlls compiled for Powershell 7.5.4 are attached to this article along with the relevant source code modifications to aid in recompilation at a future date.
Papercut v25.0.8
The source code for the DLL that ships with this version has 4 bugs that prevent compilation. A corrected version of the source code is attached to this document.
For the sake of documentation to fix compilation errors the following Methods need to be updated:
| Line |
Method |
Change |
| 356 |
BatchImportInternalUsers |
The parameter emailUserOnCreation is set to the wrong type, it is set to "Boolean" and it should be "Bool" |
| 1217 |
SharedAccountExistsId |
The return value for accountId must be converted to a string. Changed "accountId" to "accountId.ToString()" |
| 2109 |
BatchImportInternalUsers |
The parameter emailUserOnCreation is set to the wrong type, it is set to "Boolean" and it should be "Bool" |
| 2369 |
InstallLicense |
Because of the void declaration this method is not allowed to return a value. Remove the word return. |
Powershell 7.x
You will need to either know the version of .NET that Powershell was compiled against -or- install the the runtime for the version of .NET that you compiled the ServerCommandProxy.dll. The .NET version can be found on the release notes for the version of Powershell 7 that you have installed.
Powershell Release Notes can be found here: Releases · PowerShell/PowerShell
Powershell 7.5.4
At the time of this writing the currently shipping version of Powershell is version 7.5.4. Powershell 7.5.4 is compiled against .NET 9 and the currently supported release of the .NET SDK is .NET 10. You will need to update the ServerCommandProxy.proj file in the source folder to target .NET 9 by changing the <TargetFramework> line to net9.0
A ServerCommandProxy.proj that has been preconfigured for .net9.0 is attached to this article.