Bug in Get-UniversalDate

Topics: Archive - General
Jul 31, 2014 at 3:49 PM
Hello

I am starting to use this great deployment toolkit and I am hoping that you will get the integration with ServiceUI (or similar) to work.

Now to the problem.
I am using this toolkit in a company based in Denmark and beside Denmark we also have factories in other countries. One of these other locations is in Hungary.
We are using an English Windows 8.1 installation on all of our computers with locale set to their respective countries and we are managing them with SCCM 2012 R2.

I am using the Beta version 4.0 but it seems to me that the problem is the same in the stable version as well.

The problem I experienced was that when I am running an installation in Hungary with the option to defer using the following command (omitted):
Show-InstallationWelcome -CloseApps "iexp.......... -DeferTimes 3  -DeferDays 3 
The issue is that in Hungary they spell the month August like this: augusztus
The name includes a "z" and this gives an error with the toolkit because it removes the "Z" from the date this results in the following error:
[31-07-2014 14:40:18] [Pre-Installation] The date/time specified [2014. augustus 3. 14:40:18] is not specified in a format recognised by the current culture [hu-HU] (at Get-UniversalDate, C:\Windows\ccmcache\1d\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2263
at Show-InstallationWelcome, C:\Windows\ccmcache\1d\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2488
at <ScriptBlock>, C:\Windows\ccmcache\1d\Deploy-Application.ps1: line 86)
[31-07-2014 14:40:18] [Pre-Installation] Displaying Dialog Box with message: [The date/time specified [2014. augustus 3. 14:40:18] is not specified in a format recognised by the current culture [hu-HU] (at Get-UniversalDate, C:\Windows\ccmcache\1d\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2263
at Show-InstallationWelcome, C:\Windows\ccmcache\1d\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2488
at <ScriptBlock>, C:\Windows\ccmcache\1d\Deploy-Application.ps1: line 86)]...
My suggestion to fix this is to change the line number 2255 in the AppDeployMain.ps1 to the following:
If ($dateTime -match "Z$") { $dateTime = $dateTime -replace "Z$","" }
The only thing changed in the above line is the addition of a $ sign after the "Z" (regex for only match in the end of the string)

I haven't tested this in real life but it seems to work as expected on my own test environment.

Once again thanks for the great tool and keep up the good work.

Best Regards,
Christian
Coordinator
Aug 1, 2014 at 10:23 PM
Hi Christian,

Thanks for catching this and posting the fix!

We'll include in the next release.

Cheers,
Sean