8,329 questions
Hi,
The ConvertTo-Json cmdlet converts an object to a JSON-formatted string. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertto-json?view=powershell-7.5
Please note that duplicate keys are not allowed in hash tables.
$body = @{identifier1 = "order_id"; identifier2 = "common_name"; identifier3 = "sans"}
$jsonstring= $body | ConvertTo-Json
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.