Cmdlets for CSV

Build 24.0.9060

Update-CSV Cmdlet

Parameters   Output Objects  

Updates CSV data.

Syntax

Update-CSV [parameters]

Remarks

The Update-CSV cmdlet allows you to use a syntax similar to SQL UPDATE statements to update CSV data.

$conn = Connect-CSV -Location 'C:\MyCSV' -URI 'token'
Update-CSV -Connection $conn -Table "NorthwindOData" -Columns @("Username") -Values @("Ana Trujilo") -Id "1"
The Where parameter can also be used to specify the primary key of the table:
Update-CSV -Connection $conn -Table "NorthwindOData" -Columns @("Username") -Values @("Ana Trujilo") -Where "Id = '1'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-CSV -Connection $conn -Table NorthwindOData -Where "Email = '[email protected]'" | Update-CSV -Columns @("Email") -Values @("[email protected] 2")

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060