Cmdlet
Export-OfficeNotebook
Exports a live notebook or a selected saved structured output, returning the conversion report.
Syntax
Export-OfficeNotebook
[-Author <String>]
-Document <NotebookDocument>
[-FailOnLoss]
[-IncludeCode]
[-IncludeExecutionCounts]
[-IncludeInteractiveCharts]
[-IncludeInteractiveWidgets]
[-IncludeOutputs]
[-NoClobber]
[-Path] <String>
[-PreserveMarkdownSource]
[-Title <String>]
[<CommonParameters>]#Parameter set:
DocumentExport-OfficeNotebook
[-NoClobber]
-Output <NotebookOutput>
[-Path] <String>
[<CommonParameters>]#Parameter set:
SavedTableDescription
Use .pdf, .html, .md, .docx or .ps1 for live notebooks. Pipe a saved structured table to write .csv or .xlsx. The command never runs cells and preserves an existing destination if conversion fails.
Examples
Export a PDF without showing code.
$notebook | Export-OfficeNotebook -Path ./lab.pdf -IncludeCode:$false -Title 'Lab report'Export the first saved structured output from one code cell.
$notebook | Get-OfficeNotebookCell -Index 2 | Get-OfficeNotebookOutput -Index 0 | Export-OfficeNotebook -Path ./results.xlsxExtract PowerShell source without running the notebook.
$notebook | Export-OfficeNotebook -Path ./lab.ps1 -FailOnLossParameters
- Optional author for a rendered document.
- -Document NotebookDocument
- Live notebook to export to a document or a PowerShell script.
- -FailOnLoss SwitchParameter
- Reject a notebook export that reports fidelity loss before publishing a file.
- -IncludeCode SwitchParameter
- Include code in a rendered document. Enabled by default. Use -IncludeCode:$false to omit it.
- -IncludeExecutionCounts SwitchParameter
- Include saved execution counts in a rendered document. Enabled by default.
- -IncludeInteractiveCharts SwitchParameter
- Enable zoom, pan and saved data inspection in supported offline HTML charts.
- -IncludeInteractiveWidgets SwitchParameter
- Include supported, interactive saved-state widgets in a standalone HTML export.
- -IncludeOutputs SwitchParameter
- Include saved outputs in a rendered document. Enabled by default.
- -NoClobber SwitchParameter
- Refuse to replace an existing destination.
- -Path String
- Output path. The extension selects the format.
- -PreserveMarkdownSource SwitchParameter
- Preserve exact Markdown cell source in a Markdown export. Cell-local attachments are omitted with a report.
- -Title String
- Optional title for a rendered document.
- -Output NotebookOutput
- Selected saved output containing an inline structured data resource.
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.