epacke / BigIPReport

Overview of your loadbalancer configuration
https://loadbalancing.se
8 stars 2 forks source link

Certificate expiration was not recognized as a valid DateTime #182

Closed jo-xxx closed 4 years ago

jo-xxx commented 4 years ago

On my server configured with German language settings I get errors like: Line | 1031 | $expiration = [datetime]::ParseExact($Certificate.apiRawV … | ~~~~~~~~~~~~~ | Exception calling "ParseExact" with "3" argument(s): "String 'Dec 20 08:36:03 2022' was not recognized | as a valid DateTime."

Parse Exact fails because in German it would be "Dez" for December.

This worked for me: $expiration = [datetime]::ParseExact($Certificate.apiRawValues.expiration.Replace(' GMT','').Replace(" "," "),"MMM d H:mm:ss yyyy", [CultureInfo]::InvariantCulture)

timriker commented 4 years ago

looks good to me. Thanks!

jo-xxx commented 4 years ago

Solved. Thanks