Update-Excel Cmdlet
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")