Friday, 31 March 2017

PowerShell Certificate Authority List, Loop, Filter Trought CA Certificate Authority

PowerShell Loop Trought CA Certificate Authority,
Hi all, here a quick and easy PowerShell script to list and filter all details of Installed Certificate Authority, if needed filter on line(s) given from certlst.txt file

function LWebCode_CALoop
{
    $MyDir = Split-Path -Path $MyInvocation.ScriptName
    $foutput = $MyDir + "\certlst.txt"
    Get-ChildItem -Recurse Cert: > $foutput
    $reader = [System.IO.File]::OpenText($foutput)
    while($null -ne ($line = $reader.ReadLine()))
    {

        echo $line
        /* optional filter on line(s)
        if($line -Match "Thumbprint")
        {
            echo $line
        }

        */
    }
}

LWebCode_CALoop


Do inside if block your preferred stuff

No comments:

Post a Comment