Cmdlets for Microsoft Excel

Build 24.0.9060

Update-Excel Cmdlet

Parameters   Output Objects  

Updates Microsoft Excel data.

Syntax

Update-Excel [parameters]

Remarks

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

$conn = Connect-Excel -ExcelFile 'C:\MyExcelWorkbooks\SampleWorkbook.xlsx'
Update-Excel -Connection $conn -Table "Sheet" -Columns @("LastName") -Values @("Smith") -Id "5"
The Where parameter can also be used to specify the primary key of the table:
Update-Excel -Connection $conn -Table "Sheet" -Columns @("LastName") -Values @("Smith") -Where "RowId = '5'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-Excel -Connection $conn -Table Sheet -Where "FirstName = 'Bob'" | Update-Excel -Columns @("FirstName") -Values @("Bob 2")

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