# Add-OfficeNotebookCell

Appends a Markdown, code, or raw cell to a live notebook.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Notebook.NotebookDocument`

**Outputs**

`OfficeIMO.Notebook.NotebookCell`

**Source**

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

Appends a Markdown, code, or raw cell to a live notebook.

## Syntax

```
Add-OfficeNotebookCell
-Document <NotebookDocument>
[-Kind] <Unknown|Markdown|Code|Raw>
[-Language <String>]
[-PassThru]
[-Source] <String>
[<CommonParameters>]
```

[#](#method-add-officenotebookcell-notebookdocument-notebookcellkind-string-switchparameter-string)

Parameter set: `All Parameter Sets`

## Examples

### Append a PowerShell cell and return it for further editing.

```powershell
$cell = $notebook | Add-OfficeNotebookCell -Kind Code -Language PowerShell -Source 'Get-Date' -PassThru
```

## Parameters

**-Document NotebookDocument requiredpipeline: True (ByValue)**

Live notebook to extend.

**-Kind NotebookCellKind requiredposition: 0**

Kind of cell to append. Choose Markdown, Code, or Raw.

Possible values: `Unknown`, `Markdown`, `Code`, `Raw`

**-Language String optional**

Explicit language for a code cell.

**-PassThru SwitchParameter optional**

Return the appended cell.

**-Source String requiredposition: 1**

Cell text, which may be empty.

## 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:462F3BC778961B4C5C87ADBA640CE9A73F45D8527BEA6A3E46EB079BECCB2FF1 -->
