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

fix(scoop-config): Output [DateTime] as [String] #5232

Merged
merged 2 commits into from
Oct 31, 2022
Merged

Conversation

niheaven
Copy link
Member

@niheaven niheaven commented Oct 30, 2022

Description

Beginning in PowerShell 6, ConvertTo-Json attempts to convert strings formatted as timestamps to DateTime values.

https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-7.2#notes

So this fix coerce [DataTime] output to [String] to make uniform output in PS5 and PS7.

Motivation and Context

How Has This Been Tested?

PS5:

❯ scoop config last_update
2022-10-30T17:14:47.9357171+08:00

PS7 (before):

❯ scoop config last_update

2022年10月30日 17:14:47

PS7 (after):

❯ scoop config last_update
2022-10-30T17:14:47.9357171+08:00

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

@niheaven niheaven changed the title refactor(hash): Use 'Get-FileHash()' directly (#5177) fix(scoop-config): Output [DateTime] as [String] Oct 30, 2022
@chawyehsu chawyehsu merged commit d7bfe52 into develop Oct 31, 2022
@chawyehsu chawyehsu deleted the fix-config branch October 31, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants