PowerShell – Output Local Certificates to File

email me

Text file

Get-ChildItem -Path Cert:\LocalMachine -Recurse | Where-Object {$_.PSISContainer -eq $false} | Format-List -Property * | Out-File -FilePath output.txt ; cmd /c 'notepad.exe output.txt'

 

CSV file

$Certificates = Get-ChildItem Cert:\ -Recurse | Where-Object {-not $_.PSIsContainer} | Select * | Export-csv output.csv ; cmd /c output.csv