# Save-OfficeMarkdown

Saves a live Markdown document using its native save policy and keeps it available.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Markdown.MarkdownDocument`

**Outputs**

`System.IO.FileInfo`

**Source**

[SaveOfficeMarkdownCommand.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Markdown/SaveOfficeMarkdownCommand.cs#L15) 

Saves a live Markdown document using its native save policy and keeps it available.

## Syntax

```
Save-OfficeMarkdown
[-AllowLoss]
-Document <MarkdownDocument>
[-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html|HtmlWhenSized>]
[-LineEnding <LF|CRLF|CR>]
[-PassThru]
[[-Path] <String>]
[-UnorderedListMarker <-|*|+>]
[-WriteOptions <MarkdownSaveOptions>]
[-WriteProfile <OfficeIMO|Portable|HtmlImage>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-ef5d34047496774764e7a062)

Parameter set: `Document`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Parse and Inspect Markdown Files](/docs/markdown/parse-and-inspect/) Guide
  
  Load Markdown into a typed model, list headings, read and edit YAML or TOML front matter, extract tables and code blocks, and check diagnostics.

## Examples

### Save to the document's associated path.

```powershell
$document | Save-OfficeMarkdown -PassThru
```

### Write a CRLF copy.

```powershell
Save-OfficeMarkdown -Document $document -Path ./Publish/Report.md -LineEnding CRLF -PassThru
```

## Parameters

**-AllowLoss SwitchParameter optional**

Accept explicit native-save omissions, overriding WriteOptions when supplied.

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

Markdown document to save.

**-ImageRenderingMode MarkdownImageRenderingMode optional**

Controls Markdown image serialization.

Possible values: `RichMarkdown`, `PortableMarkdown`, `Html`, `HtmlWhenSized`

**-LineEnding OfficeLineEnding optional**

Output line endings.

Possible values: `LF`, `CRLF`, `CR`

**-PassThru SwitchParameter optional**

Return the saved file.

**-Path String optionalposition: 0**

Optional destination; omission saves to the associated path.

**-UnorderedListMarker String optional**

Unordered list marker.

Possible values: `-`, `*`, `+`

**-WriteOptions MarkdownSaveOptions optional**

Native save settings, or a hashtable of native option properties.

**-WriteProfile OfficeMarkdownWriteProfile optional**

Friendly Markdown writer profile.

Possible values: `OfficeIMO`, `Portable`, `HtmlImage`

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

## 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:2E78405EE36ED26C9E313C162EF2BAF0E08095690419C03B6D40349218119CFA -->
