Udostępnij za pośrednictwem


JsonObject.ConvertFromJson Method

Definition

Overloads

ConvertFromJson(String, ErrorRecord)

Convert a Json string back to an object of type PSObject.

ConvertFromJson(String, Boolean, ErrorRecord)

Convert a Json string back to an object of type PSObject or Hashtable depending on parameter returnHashtable.

ConvertFromJson(String, Boolean, Nullable<Int32>, ErrorRecord)

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.

public:
 static System::Object ^ ConvertFromJson(System::String ^ input, [Runtime::InteropServices::Out] System::Management::Automation::ErrorRecord ^ % error);
public static object ConvertFromJson (string input, out System.Management.Automation.ErrorRecord error);
static member ConvertFromJson : string * ErrorRecord -> obj
Public Shared Function ConvertFromJson (input As String, ByRef error As ErrorRecord) As Object

Parameters

input
String

The json text to convert.

error
ErrorRecord

An error record if the conversion failed.

Returns

A PSObject.

Applies to

ConvertFromJson(String, Boolean, ErrorRecord)

Convert a Json string back to an object of type PSObject or Hashtable depending on parameter returnHashtable.

public static object ConvertFromJson (string input, bool returnHashtable, out System.Management.Automation.ErrorRecord error);
static member ConvertFromJson : string * bool * ErrorRecord -> obj
Public Shared Function ConvertFromJson (input As String, returnHashtable As Boolean, ByRef error As ErrorRecord) As Object

Parameters

input
String

The json text to convert.

returnHashtable
Boolean

True if the result should be returned as a Hashtable instead of a PSObject

error
ErrorRecord

An error record if the conversion failed.

Returns

A PSObject or a Hashtable if the returnHashtable parameter is true.

Applies to

ConvertFromJson(String, Boolean, Nullable<Int32>, ErrorRecord)

Convert a JSON string back to an object of type PSObject or Hashtable depending on parameter returnHashtable.

public static object ConvertFromJson (string input, bool returnHashtable, int? maxDepth, out System.Management.Automation.ErrorRecord error);
static member ConvertFromJson : string * bool * Nullable<int> * ErrorRecord -> obj
Public Shared Function ConvertFromJson (input As String, returnHashtable As Boolean, maxDepth As Nullable(Of Integer), ByRef error As ErrorRecord) As Object

Parameters

input
String

The JSON text to convert.

returnHashtable
Boolean

True if the result should be returned as a Hashtable instead of a PSObject.

maxDepth
Nullable<Int32>

The max depth allowed when deserializing the json input. Set to null for no maximum.

error
ErrorRecord

An error record if the conversion failed.

Returns

A PSObject or a Hashtable if the returnHashtable parameter is true.

Applies to