Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 3.0 » ConvertTo-Json

ConvertTo-Json - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

ConvertTo-Json

Short description
Converts an object to a JSON-formatted string

Syntax
ConvertTo-Json [-InputObject] <Object> [-Compress] [-Depth <Int32>] [<CommonParameters>]





Description
The ConvertTo-Json cmdlet converts any object to a string in JavaScript Object Notation (JSON) format. The properties a
re converted to field names, the field values are converted to property values, and the methods are removed.


You can then use the ConvertFrom-Json cmdlet to convert a JSON-formatted string to a JSON object, which is easily manag
ed in Windows PowerShell.


Many web sites use JSON instead of XML to serialize data for communication between servers and web-based apps.


This cmdlet is introduced in Windows PowerShell 3.0.