CSNAPC-8159: SnapCenter CmdLet Refresh-SmSnaplock -All errors on non-US dates when user's locale has non-US date formatting
Issue
Running Refresh-SmSnapLock -All from SC commandlet after logging in using Open-SmConnection with a SnapCenterAdmin roled account throws the below unhandled exception on the same date/time multiple times (the date/time values are digits where day "dd" is bigger than 12):UpdateSnaplockSettings failed with error: String 'dd.MM.YYYY HH:mm:ss' was not recognized as a valid DateTime.
System.FormatException: String 'dd.MM.YYYY HH:mm:ss' was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.Convert.ToDateTime(String value)
at SnapManager.SMSDALHelper.SnapLockHelper.<>c.<FindMaxSnapLockExpTime>b__1_2(String s)
The log file is the SnapManagerWeb_<JOB_ID>.log
from the Job History's log package, or from %PROGRAMFILES%\NetApp\SnapCenter WebApp\App_Data\log