I have been using the EnhancedHTML2 module to create some reports for my work and have ran into a problem/odity. Whenever I output a object to the “ConvertTo-EnhancedHTMLFragment” that has a date field it amends the date format from my locale which is UK to US. The best example I can give is if run the following on my own or any other pc’s in my enterprise then I get the correct date format being output under the “timecreated” field i.e dd/MM/yyyy
Get-WinEvent application | ConvertTo-Html -Fragment | Out-File C:\temp\test.html
However when I run the following
Get-WinEvent application | ConvertTo-EnhancedHTMLFragment | Out-File C:\temp\test.html
The “timecreated” field is now displayed is US format i.e. MM/dd/yyyy
I can solve the display issue by simply converting the output to a string with the correct format but then I can’t sort that table by date.
Really hoping somebody has a clue as to why this would happen as I have tried everything I can think of of nothing seems to give me a clue why the function would convert the date in this way.