Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Export-OfficeConversionJob

Module PSWriteOffice
Inputs
System.Object[]
Outputs
System.IO.FileInfo

Saves a portable conversion job for Studio, the command-line tool and PowerShell.

Syntax

Export-OfficeConversionJob [-CheckpointDirectory <String>] [-ConflictPolicy <Fail|Rename|Replace>] [-ConversionOptions <OfficeWorkflowConversionOptions>] [-ConversionRouteId <String>] [-Force] -InputDirectory <String> [-MaximumConcurrency <Int32>] [-MaximumFiles <Int32>] [-MaximumInputBytes <Int64>] [-MaximumOutputBytes <Int64>] [-MaximumXmlCharactersInPart <Int64>] [-Name <String>] [-NoRecurse] -OutputDirectory <String> [-OutputProfile <Faithful|Lightweight|PrintReady|TextOnly>] [-Path] <String> [-PdfPasswordEnvironmentVariable <String>] [-SourceExtension <String[]>] [-SourcePasswordEnvironmentVariable <String>] [-TargetExtension <String>] [<CommonParameters>]
#
Parameter set: Directory
Export-OfficeConversionJob [-CheckpointDirectory <String>] [-ConflictPolicy <Fail|Rename|Replace>] [-ConversionOptions <OfficeWorkflowConversionOptions>] [-ConversionRouteId <String>] [-Force] -InputPath <Object[]> [-MaximumConcurrency <Int32>] [-MaximumFiles <Int32>] [-MaximumInputBytes <Int64>] [-MaximumOutputBytes <Int64>] [-MaximumXmlCharactersInPart <Int64>] [-Name <String>] -OutputDirectory <String> [-OutputProfile <Faithful|Lightweight|PrintReady|TextOnly>] [-Path] <String> [-PdfPasswordEnvironmentVariable <String>] [-SourcePasswordEnvironmentVariable <String>] [-TargetExtension <String>] [<CommonParameters>]
#
Parameter set: Files

Description

Requires PowerShell 7.4 or newer. Saving records intent and never converts documents. Relative paths are based on the saved job's folder. Native renderer callbacks and settings outside the portable contract are rejected instead of omitted.

Examples

Authored help example

Save a resumable conversion job, inspect its plan, then run it.

Export-OfficeConversionJob -InputDirectory ./source -OutputDirectory ./pdf -CheckpointDirectory ./state -Path ./monthly.officejob.json
Invoke-OfficeConversionJob -Path ./monthly.officejob.json -Plan
Invoke-OfficeConversionJob -Path ./monthly.officejob.json -ErrorAction Stop

Save selected files with a runtime password reference.

Get-ChildItem ./reports -Filter *.docx | Export-OfficeConversionJob -OutputDirectory ./pdf -Path ./reports.officejob.json -SourcePasswordEnvironmentVariable DOCUMENT_PASSWORD

Parameters

-CheckpointDirectory String optional
Optional durable state directory outside source and output folders. Registered adapter routes do not support checkpoints.
-ConflictPolicy String optional
Existing destination behavior. Durable checkpoint jobs require Fail.
Possible values: Fail, Rename, Replace
-ConversionOptions OfficeWorkflowConversionOptions optional
Portable scalar reconstruction and plain-text settings from New-OfficeConversionOptions. Unsupported native settings are rejected.
-ConversionRouteId String optional
Optional exact executable conversion route identifier.
-Force SwitchParameter optional
Replace an existing job file. Source documents and protected execution paths remain protected.
-InputDirectory String requiredsets: Directory
Source directory to discover when the job runs.
-MaximumConcurrency Int32 optional
Maximum simultaneously executing conversion items.
-MaximumFiles Int32 optional
Maximum discovered or selected files.
-MaximumInputBytes Int64 optional
Maximum input bytes per document.
-MaximumOutputBytes Int64 optional
Maximum output bytes per document.
-MaximumXmlCharactersInPart Int64 optional
Maximum XML characters per part for applicable conversions.
-Name String optional
Optional descriptive job name.
-NoRecurse SwitchParameter optionalsets: Directory
Do not discover source subdirectories.
-OutputDirectory String required
Destination directory for converted documents.
-OutputProfile String optional
Shared output intent, subject to each route's supported profiles.
Possible values: Faithful, Lightweight, PrintReady, TextOnly
-Path String requiredposition: 0aliases: LiteralPath
Destination JSON file. Existing job files require Force.
-PdfPasswordEnvironmentVariable String optional
Runtime environment variable supplying a PDF input password. Only the name is saved.
-SourceExtension String[] optionalsets: Directory
Restrict directory discovery to these source extensions.
-SourcePasswordEnvironmentVariable String optional
Runtime environment variable supplying an encrypted Office input password. Only the name is saved.
-TargetExtension String optional
Destination format extension, with or without the leading dot.
-InputPath Object[] requiredpipeline: True (ByValue, ByPropertyName)aliases: FullNamesets: Files
Selected source path strings or FileInfo objects.

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.