xPSDesiredStateConfiguration icon indicating copy to clipboard operation
xPSDesiredStateConfiguration copied to clipboard

xArchive throws Exception setting "LastWriteTime"

Open rseniuta opened this issue 8 years ago • 5 comments

I am trying to unzip logstash archive and I am getting following error on first file:

Exception setting "LastWriteTime": "Cannot convert value "24.02.2017 17 :47:52" to type "System.DateTime". Error: "String was not recognized as a valid DateTime.""

https://artifacts.elastic.co/downloads/logstash/logstash-5.2.2.zip

rseniuta avatar Mar 06 '17 14:03 rseniuta

@rseniuta What version of xPSDesiredStateConfiguration/PSDscResources are you using? Did you download from Github or the PowerShell Gallery? This resource is getting released with a huge update tomorrow that may have already fixed this problem. You can see the changes in #319

kwirkykat avatar Mar 07 '17 20:03 kwirkykat

I am using latest version from github.

rseniuta avatar Mar 08 '17 07:03 rseniuta

@rseniuta Seems like a culture issue. I tried upzipping that same file on my test machine. I actually got a different error, but once that was fixed, I didn't see the same error you were getting. That is on an en-US culture machine.

Though I do see the same error if I call Get-Date "24.02.2017 17:47:52" on my en-US machine.

kwirkykat avatar Mar 11 '17 01:03 kwirkykat

Same issue exists in PSDscResources, should I raise on that repo too?

I haven't looked at this in depth but is there perhaps a culture invariant format? A quick google search reveled this. http://blogs.microsoft.co.il/scriptfanatic/2011/04/14/converting-date-strings-in-powershell/

Having to revert back to the in-built archive resource now.

andy1547 avatar May 04 '17 15:05 andy1547

@andy1547 If this a problem in PSDscResources resource module, then go ahead and raise the issue there as well

johlju avatar May 15 '18 09:05 johlju