My idea is to have a powershell code that is available for both (windows and ubuntu) with few changes (like the path in get-childitem),so I tried the following script on ubuntu , but did not work on windows and it shows me the following error
openssl.exe : Can't open [Subject]
At line:5 char:10
- $var = ((& C:\OpenSSL-Win64\bin\openssl.exe x509 -in $File -dates -no ...
Here is the code that I've wrote:
$files = get-childitem Cert:\LocalMachine\My
foreach ($File in $files)
{
$var = ((& C:\OpenSSL-Win64\bin\openssl.exe x509 -in $File -dates -noout) -
match 'notAfter')
Write-Host $var
}
Another remark: what syntaxe to use with openssl to get certificate name