Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xArchive: Get-ArchiveEntryLastWriteTime Does Not Return [DateTime] returns generalized String #471

Closed
PlagueHO opened this issue Jan 11, 2019 · 0 comments · Fixed by #472
Assignees
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@PlagueHO
Copy link
Member

Details of the scenario you tried and the problem that is occurring

The Get-ArchiveEntryLastWriteTime function in xArchive should return a [system.datetime] (and the output type report that), but instead it generalizes it to a string.

This causes all sorts of date translation issues on machines with non-US date formats. Including test failures and other very difficult to diagnose issues.

We should avoid converting date/times to/from string when we need to compare them.

I'll be fixing this in a PR shortly (once I can get all the other broken archive tests sorted).

Verbose logs showing the problem

https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xArchive/MSFT_xArchive.psm1#L992

Suggested solution to the issue

Correct 'Get-ArchiveEntryLastWriteTime' to return [datetime]

The DSC configuration that is used to reproduce the issue (as detailed as possible)

N/A

The operating system the target node is running

OsName               : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1803
WindowsBuildLabEx    : 17134.1.amd64fre.rs4_release.180410-1804
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17134.407
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.407
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

dev

I expect this is the same in PSDscResources - so I'll raise and fix over there too.

@PlagueHO PlagueHO added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Jan 18, 2019
@PlagueHO PlagueHO self-assigned this Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant