-
Notifications
You must be signed in to change notification settings - Fork 8.1k
(#15949) Fix regression in Add-History #16005
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
(#15949) Fix regression in Add-History #16005
Conversation
Add-History was not respecting the culture settings and throwing when given any non-US datetime format. Fixed by ensuring we use the current culture for the conversion.
62fe083 to
51cc480
Compare
| } | ||
| ) | ||
|
|
||
| $oldCulture = [cultureinfo]::CurrentCulture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below:
| $oldCulture = [cultureinfo]::CurrentCulture | |
| $oldCulture = [CultureInfo]::CurrentCulture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to have a type accelerator for this, so I'd argue that [cultureinfo] is preferred, like [bool] or [pscustomobject]
|
🎉 Handy links: |
PR Summary
Use CurrentCulture when handling conversions to DateTime in Add-History.
PR Context
Fixing a regression in Add-History that was inadvertently introduced in #12495 and made the conversions used by Add-History culture invariant by mistake.
Fixes #15949
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).