PSPKI
PSPKI copied to clipboard
Typedata error when importing PSPKI module at console session
I received this error when importing the PSPKI module, version 3.7.2, from an elevated PowerShell session.
PS C:\scripts> ipmo pspki Update-TypeData : Error in TypeData "System.Security.Cryptography.Oid": The member ToString is already present. At C:\Program Files\WindowsPowerShell\Modules\pspki\3.7.2\PSPKI.psm1:287 char:5
-
Update-TypeData -AppendPath $PSScriptRoot\Types\PSPKI.PS5Types.ps ... -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidOperation: (:) [Update-TypeData], RuntimeException
- FullyQualifiedErrorId : TypesXmlUpdateException,Microsoft.PowerShell.Commands.UpdateTypeDataCommand
I have never received this before. Even after running Remove-Module PSPKI and re-importing the module the same error appears. What is happening to cause this error to be thrown?
Note: Import-Module -Name PSPKI in an ISE console does not throw any errors.
As a temporary fix, you can comment this block in PSPKI.psm1 file: https://github.com/PKISolutions/PSPKI/blob/4522ee48755450f3129352f029bfdb9c484f2dd9/PSPKI/PSPKI.psm1#L289
Closed as stale.