PSPKI
PSPKI copied to clipboard
Revoke-Certificate - Throwing exception Cannot find an appropriate constructor
Hello,
I've tried to find something but could not find anything close to what I'm experiencing when trying to use the Revoke-Certificate cmdlet the following exception is being thrown:
New-Object : A constructor was not found. Cannot find an appropriate constructor for type
SysadminsLV.PKI.Utils.ServiceOperationResult.
At C:\Program Files\WindowsPowerShell\Modules\PSPKI\4.2.0\Server\Revoke-Certificate.ps1:52 char:13
+ New-Object SysadminsLV.PKI.Utils.ServiceOperationResult $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand
As it is stated in the exception message module version in use is 4.2.0, I did not have the time to properly debug the whole thing but exception is being thrown at line 49 of the Revoke-Certificate function where code reads:
$CertAdmin.RevokeCertificate($Request.ConfigString,$Request.SerialNumber,$Reasons[$Reason],$RevocationDate.ToUniversalTime())
New-Object SysadminsLV.PKI.Utils.ServiceOperationResult 0,
"Successfully revoked certificate with ID=$($Request.RequestID) and reason: '$Reason'"
} catch {
New-Object SysadminsLV.PKI.Utils.ServiceOperationResult $($_.Exception.InnerException.InnerException.HResult)
}
I will try to find some time to further troubleshoot this but if someone experienced this issue or has any pointer I would really appreciate it.