Commit 683187a
authored
Fix handling of numerical configuration properties across PS5 and PS7 (#262)
`ConvertFrom-Json` defaults numbers to different types depending on the PowerShell version.
PS5 defaults numbers to `[Int32]` while PS7 defaults numbers to `[Int64]`, but both versions default to `[Int32]` in a `[PSCustomObject]`.
Due to this, if you had a number config value saved, on PS7 it would be ignored and the default value would be used because the expected and actual types wouldn't match.
I've updated `Resolve-PropertyValue` to have equivalence logic for number types to avoid this issue.1 parent 79e5ac2 commit 683187a
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
472 | | - | |
| 473 | + | |
| 474 | + | |
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
478 | | - | |
| 480 | + | |
479 | 481 | | |
480 | 482 | | |
481 | 483 | | |
| |||
0 commit comments