Commit 9eeee79
committed
Fix serialization of PSCustomObject wrapped object
With the switch away from converting PSCustomObjects to dictionaries
we broke the way values that are wrapped in a PSCustomObject are serialized.
This is evident when values of hashtables are generated using Write-Output
which generates a PSCustomObject (Which is not evident in powershell, as
there is a lot of magic in powershell), but is clearly evident when we try
to use an object generated in PowerShell, in C#.
This change looks at the nested type of a PSCustomObject, and unwraps it
if it's not just another PSCustomObject.
Fixes: #157
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>1 parent 7e2611b commit 9eeee79
4 files changed
Lines changed: 26 additions & 1 deletion
File tree
- Tests
- lib
- net47
- netstandard2.1
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
31 | 46 | | |
32 | 47 | | |
33 | 48 | | |
| |||
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
| |||
0 commit comments