JSON 标准允许在 PSObject 和 Hashtable 类型中禁止重复的键名称。 例如,如果 JSON 字符串包含重复键,则此 cmdlet 将仅使用最后一个键。 请参阅下面的其他示例。 若要从任何对象生成 JSON 字符串,请使用 ConvertTo-Json cmdlet。 此cmdlet 是在 PowerShell 3.0 中引入的。 备注 从PowerShell 6 开始,cmdlet 支...
but if anything happens to be relying on the specific type (e.g., using reflection APIs to do something with the hashtable, or just simply checking the output type for one reason or another) will break.
Convert a JSON string back to an object of type PSObject or Hashtable depending on parameter returnHashtable. ConvertFromJson(String, ErrorRecord) Convert a Json string back to an object of type PSObject. C++ 複製 public: static System::Object ^ ConvertFromJson(System::String ^ input, [Run...
Convert a JSON string back to an object of typePSObjectorHashtabledepending on parameterreturnHashtable. ConvertFromJson(String, ErrorRecord) Convert a Json string back to an object of type PSObject. C++ public:staticSystem::Object ^ ConvertFromJson(System::String ^ input, [Runtime::InteropServices...
Convert a JSON string back to an object of type PSObject or Hashtable depending on parameter returnHashtable. C# 복사 public static object ConvertFromJson (string input, bool returnHashtable, int? maxDepth, out System.Management.Automation.ErrorRecord error); Parameters input String The JSON...
Convert a JSON string back to an object of type PSObject or Hashtable depending on parameter returnHashtable. ConvertFromJson(String, ErrorRecord) Convert a Json string back to an object of type PSObject. C++ 复制 public: static System::Object ^ ConvertFromJson(System::String ^ input, [Run...
Convert a JSON string to a hash table. '{ "key":"value1", "Key":"value2" }' | ConvertFrom-Json -AsHashtable The JSON string contains two key value pairs with keys that differ only in casing. Without the -AsHashtable switch, the command will throw an error....
OrderedHashtable 备注 此cmdlet 是使用Newtonsoft Json.NET实现的。 从PowerShell 6 开始,ConvertTo-Json尝试将格式化为时间戳的字符串转换为DateTime值。 PowerShell 7.5 添加了DateKind参数,可用于控制时间戳字符串的转换方式。 该参数接受以下值: Default- 根据以下规则将时间戳转换为[datetime]实例: ...
OrderedHashtable 备注 此cmdlet 是使用Newtonsoft Json.NET实现的。 从PowerShell 6 开始,ConvertTo-Json尝试将格式化为时间戳的字符串转换为DateTime值。 PowerShell 7.5 添加了DateKind参数,可用于控制时间戳字符串的转换方式。 该参数接受以下值: Default- 根据以下规则将时间戳转换为[datetime]实例: ...
Convert a Json string back to an object of type PSObject or Hashtable depending on parameter returnHashtable. C# نسخ public static object ConvertFromJson (string input, bool returnHashtable, out System.Management.Automation.ErrorRecord error); Parameters input String The json text to co...