Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeEpub

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Epub.EpubPublication System.IO.FileInfo

Creates a live EPUB publication or saves a completed chapter/resource block.

Syntax

New-OfficeEpub
[-Author <String>]
[-Force]
[-Identifier <String>]
[-Language <String>]
[[-Path] <String>]
-Title <String>
[-Version <Epub2|Epub3>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Live
New-OfficeEpub
[-AllowLoss]
[-Author <String>]
[-Content] <ScriptBlock>
[-Force]
[-Identifier <String>]
[-Language <String>]
[-PassThru]
[-Path] <String>
[-Show]
-Title <String>
[-Version <Epub2|Epub3>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Content

Description

Without a block no file is written. A completed block saves atomically and requires Force to replace an existing destination.

Examples

Create a handbook and save its completed content.

New-OfficeEpub -Path ./Operations.epub -Title Operations -Author Example {
    EpubChapter -Title Opening -Text 'Safety and care'
}

Create a live publication and save it explicitly.

$book = New-OfficeEpub -Path ./Operations.epub -Title Operations
$book | Add-OfficeEpubChapter -Title Opening -Text 'Safety and care'
Save-OfficeEpub -Document $book

Parameters

-Author String optional
Primary author.
-Force SwitchParameter optional
Allow a completed content block to replace an existing destination.
-Identifier String optional
Optional stable publication identifier.
-Language String optional
BCP 47 language.
-Path String required in Contentposition: 0aliases: FilePath
Optional associated destination for a live document; required when a content block saves a file.
-Title String required
Publication title.
-Version EpubVersion optional
EPUB package generation.
Possible values: Epub2, Epub3
-WhatIf SwitchParameter optional
Shows what would happen if the command runs.
-Confirm SwitchParameter optional
Prompts for confirmation before running the command.
-AllowLoss SwitchParameter optionalsets: Content
Explicitly accept reductions reported by the content block's native save.
-Content ScriptBlock requiredposition: 1sets: Content
Authoring block to complete before the document is atomically saved and closed.
-PassThru SwitchParameter optionalsets: Content
Return the saved FileInfo after a completed content block.
-Show SwitchParameter optionalsets: Content
Open the saved result in its registered application after the content block succeeds.

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.