Skip to content

Version error in Get-LDAPCert script #13

Description

@IJustKnowStuff

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions