OpsaC - Operating as PowerShell code
published: September 13, 2018 author: Tinu tags: Certificate categories: PowerShell
$ret = @()
$Issuer = '*'
$certs = Get-ChildItem Cert:\LocalMachine -Recurse | Where-Object Issuer -match "CN=$Issuer"
foreach($item in $certs){
$obj = [PSCustomObject]@{
Issuer = $item.Issuer
NotBefore = $item.NotBefore.Date
NotAfter = $item.NotAfter.Date
KeySize = $item.PublicKey.Key.KeySize
}
$ret += $obj
}
$ret