PowerShell.tiPS icon indicating copy to clipboard operation
PowerShell.tiPS copied to clipboard

Bug: MethodInvocationException: Exception calling "Parse" with "1" argument(s): "String '5/14/2024 12:00:00 AM' was not recognized as a valid DateTime."

Open BenjaminEngeset opened this issue 1 year ago • 1 comments

Describe the bug

Occured on macOS after updating PowerShell to 7.4.2.

When invoking the tiPS module the following is emitted to the error stream:

MethodInvocationException: Exception calling "Parse" with "1" argument(s): "String '5/14/2024 12:00:00 AM' was not recognized as a valid DateTime."

https://github.com/deadlydog/PowerShell.tiPS/blob/main/src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1#L93

To write the date in a better format. Say .ToString('o') instead of dumping it out in whatever format the OS likes to use.

That way, when this line runs: https://github.com/deadlydog/PowerShell.tiPS/blob/main/src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1#L77 it won't die horribly if the format changes.

BenjaminEngeset avatar May 14 '24 08:05 BenjaminEngeset

Nice catch, and thanks for the proposed fix 🙂👍

deadlydog avatar May 14 '24 17:05 deadlydog

This should not be fixed in v1.3.7. Let me know if you still have issues with that version. Thanks!

deadlydog avatar May 20 '24 22:05 deadlydog