Sample code for 30+ languages & platforms
PowerShell

Example: JsonObject.NewArrayOf method

See more JSON Examples

Demonstrates the NewArrayOf method.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

$big_cats = "[`"lion`",`"tiger`",`"leopard`",`"jaguar`",`"cheetah`",`"snow leopard`",`"clouded leopard`",`"cougar`",`"puma`",`"panther`"]"

$json = New-Object Chilkat.JsonObject

$json.UpdateString("test","abc")

$success = $json.NewArrayOf("big_cats",$big_cats)
if ($success -eq $false) {
    $($json.LastErrorText)
    exit
}

$json.EmitCompact = $false
$($json.Emit())

# Result:

# {
#   "test": "abc",
#   "big_cats": [
#     "lion",
#     "tiger",
#     "leopard",
#     "jaguar",
#     "cheetah",
#     "snow leopard",
#     "clouded leopard",
#     "cougar",
#     "puma",
#     "panther"
#   ]
# }