Update-JSON Cmdlet
Updates JSON data.
Syntax
Update-JSON [parameters]
Remarks
The Update-JSON cmdlet allows you to use a syntax similar to SQL UPDATE statements to update JSON data.
$conn = Connect-JSON -DataModel 'Relational' -URI 'C:\people.json' Update-JSON -Connection $conn -Table "NorthwindOData" -Columns @("personal.name.last") -Values @("Ana Trujilo") -Id "1"The Where parameter can also be used to specify the primary key of the table:
Update-JSON -Connection $conn -Table "NorthwindOData" -Columns @("personal.name.last") -Values @("Ana Trujilo") -Where "Id = '1'"The primary key can also be passed to the cmdlet along the pipeline:
Select-JSON -Connection $conn -Table NorthwindOData -Where "personal.name.last = '[email protected]'" | Update-JSON -Columns @("personal.name.last") -Values @("[email protected] 2")