Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeNotebookCell

Module
PSWriteOffice
Inputs
OfficeIMO.Notebook.NotebookDocument
Outputs
OfficeIMO.Notebook.NotebookCell

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>]
#
Parameter set: All Parameter Sets

Examples

Append a PowerShell cell and return it for further editing.

$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.