【发布时间】:2021-02-25 18:29:33
【问题描述】:
我在从 json 有效负载转换一些数据时遇到了一些问题。我得到的最接近的是将其转换为如下所示的 PSCustomObject;
Fields
------
{@{short=true; title=Status; value=Status text.}, @{short=true; title=Type; value=Type text.}, @{short=false; title=Detail; value=This is some example detail text.}}
但是我需要将其转换为以下格式的哈希表。任何帮助将不胜感激。
Name Value
---- -----
short true
title Status
value Status text.
short true
title Type
value Type text.
short false
title Detail
value This is some example detail text.
谢谢,
【问题讨论】:
-
从您的 json 有效负载开始并展示其结构可能更容易。例如。从
ConvertFrom-Json -AsHashTable开始可能会更好...
标签: powershell hashtable pscustomobject