# Open-OfficeNotebook

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

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`System.String`

**Outputs**

`OfficeIMO.Notebook.NotebookDocument`

**Source**

[OpenOfficeNotebookCommand.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Notebook/OpenOfficeNotebookCommand.cs#L21) 

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>]
```

[#](#method-open-officenotebook-string-string-switchparameter-notebookimportformat-notebookloadoptions-string-string)

Parameter set: `Path`

```
Open-OfficeNotebook
[-CompanionPath <String>]
[-DeepnoteNotebookId <String>]
[-FailOnLoss]
[-Format <NotebookImportFormat>]
-LiteralPath <String>
[-LoadOptions <NotebookLoadOptions>]
[-ScriptLanguage <String>]
[<CommonParameters>]
```

[#](#method-open-officenotebook-string-string-switchparameter-notebookimportformat-string-notebookloadoptions-string)

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.

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

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

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:1F517E52F9E44C2816476AB3DE16BA1728A160516B6D6C07395392728B5CB708 -->
