Skip to content

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

Merged
chawyehsu merged 2 commits intodevelopfrom
fix-config
Oct 31, 2022
Merged

fix(scoop-config): Output [DateTime] as [String]#5232
chawyehsu merged 2 commits intodevelopfrom
fix-config

Conversation

@niheaven
Copy link
Copy Markdown
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