ConvertFrom-KFJSON

Syntax

ConvertFrom-KFJSON 
  [-JSON] <string> 
  [-ThrowErrors[:$true]]

Support

>= kenaflow 1.0.0

Return

PowerShell Hashtable object.

Description

The default PowerShell command ConvertFrom-JSON returns JSON serialized objects as PSObject objects (System.Management.Automation.PSObject) with properties. This is sometimes not sufficient, because it will fail if the JSON string contains for example two properties with the same name but different cases: {"Test":"kenaflow","test":"cool"}.

Our cmdlet converts the JSON to a PowerShell Hashtable. It can handle keys with different upper and lower case.

The following example shows the difference between the default Cmdlet and the kenaflow Cmdlet:

Parameters

[-JSON] <string>

The JSON serialized object to be deserialized.

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to $true (default!) the engine will pass exception within the cmdlet to the script for further handling.

Example

ConvertFrom-KFJSON -JSON '{"Test":"kenaflow","test":"cool"}'

Discussion