Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version error in Get-LDAPCert script #13

Open
IJustKnowStuff opened this issue Apr 18, 2023 · 0 comments
Open

Version error in Get-LDAPCert script #13

IJustKnowStuff opened this issue Apr 18, 2023 · 0 comments

Comments

@IJustKnowStuff
Copy link

IJustKnowStuff commented Apr 18, 2023

Get-DLAPCert script has the following:

$OpenSSLExeInfo = Get-Item $(Get-Command openssl).Source
$OpenSSLExeVersion = [version]$($OpenSSLExeInfo.VersionInfo.ProductVersion -split '-')[0]

Unfortunately, openssl version format can end in a letter, which results in an error: e.g. Version "1.1.1f" will fail.

I used the ProductVersionRaw property to return the correct/compatible value:

$OpenSSLExeVersion = [version]$($OpenSSLExeInfo.VersionInfo.ProductVersionRaw)

this will result in the correct version number being returned, and in the [version] format already:

$($OpenSSLExeInfo.VersionInfo.ProductVersionRaw)

Major  Minor  Build  Revision
-----  -----  -----  --------
1      1      1      6      

P.S. Fantastic script btw. Was trying to figure out how to confirm what certificate was being used for LDAPS connections via PowerShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant