Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Open-OfficeNotebook

Module
PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Notebook.NotebookDocument

Opens a Jupyter notebook or imports a saved notebook source into the editable model.

Syntax

Open-OfficeNotebook
[-CompanionPath <String>]
[-DeepnoteNotebookId <String>]
[-FailOnLoss]
[-Format <NotebookImportFormat>]
[-LoadOptions <NotebookLoadOptions>]
[-Path] <String>
[-ScriptLanguage <String>]
[<CommonParameters>]
#
Parameter set: Path
Open-OfficeNotebook
[-CompanionPath <String>]
[-DeepnoteNotebookId <String>]
[-FailOnLoss]
[-Format <NotebookImportFormat>]
-LiteralPath <String>
[-LoadOptions <NotebookLoadOptions>]
[-ScriptLanguage <String>]
[<CommonParameters>]
#
Parameter set: LiteralPath

Description

Notebook cells remain inert. Close the returned document after using its source-backed values. Imported sources require an explicit .ipynb destination when saving.

Examples

Open a native notebook and inspect code cells.

$notebook = Open-OfficeNotebook -LiteralPath ./lab.ipynb
$notebook | Get-OfficeNotebookCell -Kind Code
$notebook | Close-OfficeNotebook

Import a Jupytext script with a matching saved-output companion.

Open-OfficeNotebook -LiteralPath ./lab.py -Format JupytextPercent -CompanionPath ./lab.ipynb -FailOnLoss

Parameters

-CompanionPath String optional
Literal path to a Jupyter notebook whose saved outputs may be matched to a Jupytext script.
-DeepnoteNotebookId String optional
Exact notebook identifier within a Deepnote project.
-FailOnLoss SwitchParameter optional
Reject source findings that describe fidelity loss.
-Format NotebookImportFormat optional
Explicit import profile for ambiguous source extensions. Omission uses native .ipynb or an unambiguous import extension.
Possible values: PolyglotDib, JupytextPercent, Quarto, MySTMarkdown, RMarkdown, RNotebookHtml, Deepnote, Zeppelin, PowerShellScript
-LoadOptions NotebookLoadOptions optional
Native resource limits or a hashtable of limit properties, applied to input and companion files.
-Path String requiredposition: 0pipeline: True (ByValue)sets: Path
Notebook path with FileSystem wildcard expansion.
-ScriptLanguage String optional
Optional language override for Jupytext percent comment markers.
-LiteralPath String requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Literal notebook path, including FileInfo.FullName or provider PSPath from a pipeline.

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.