# Set-OfficeNotebookCell

Updates cell text or a saved code-cell execution count without running code.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Notebook.NotebookCell`

**Outputs**

`OfficeIMO.Notebook.NotebookCell`

**Source**

[SetOfficeNotebookCellCommand.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Notebook/SetOfficeNotebookCellCommand.cs#L12) 

Updates cell text or a saved code-cell execution count without running code.

## Syntax

```
Set-OfficeNotebookCell
-Cell <NotebookCell>
[-ExecutionCount <Int32>]
[-PassThru]
[-Source <String>]
[<CommonParameters>]
```

[#](#method-set-officenotebookcell-notebookcell-int32-switchparameter-string)

Parameter set: `All Parameter Sets`

## Examples

### Replace one cell's source and clear its execution count.

```powershell
$notebook | Get-OfficeNotebookCell -Index 1 | Set-OfficeNotebookCell -Source 'Get-Date' -ExecutionCount $null
```

## Parameters

**-Cell NotebookCell requiredpipeline: True (ByValue)**

Cell to edit. Keep its notebook open until the edit is complete.

**-ExecutionCount Int32 optional**

Saved execution count for a code cell. Supply $null to clear it.

**-PassThru SwitchParameter optional**

Return the updated cell.

**-Source String optional**

Replacement cell text.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:D3A1080D73DB2AABD458AB6B708ED9099BAFEDAA064CB4C3B9792EA2976D1183 -->
