Decode an X509 Certificate and present it as a PowerShell Object. Certificate PowerShell Object details updated to include the X509 Certificate time to expiry (timeToExpiry).
Available in the PowerShell Gallery
Module updated thanks to Ben's PR to support Linux (LF) in addition to the existing Windows (CRLF) line ending.
Install direct from the PowerShell Gallery (Powershell 5.x and above)
install-module -name X509Details
Decode an X509 Certificate and present it as a PowerShell Object. Certificate PowerShell Object details updated to include the X509 Certificate time to expiry (timeToExpiry).
The X509 Certificate to decode and udpate with time to expiry
Certificate from Pipeline.
PowerShell Object
Get-X509Details('certBase64String')
PS> Get-X509Details('MIIDtzCCAp+gAwIBAgIQZpJpy9zmR........URpc0T9DzsUUfoHfbQ==')
or
PS> 'MIIDtzCCAp+gAwIBAgIQZpJpy9zmR........URpc0T9DzsUUfoHfbQ==' | Get-X509Details
or
PS> Get-X509Details('-----BEGIN CERTIFICATE-----
MIIDtzCCAp
........URpc0T9DzsUUfoHfbQ==
-----END CERTIFICATE-----
')