Cmdlet
Convert-OfficeDocument
Converts files through OfficeIMO's native routes and portable batch engine.
Syntax
Convert-OfficeDocument
[-AllowEmpty]
[-AllowLegacyImportLoss]
[-AsString]
[-AutoRename]
[-CheckpointPath <String>]
[-CompressPdf]
[-Extension <String[]>]
[-FailOnLoss]
[-From <String>]
[-JobName <String>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory <String>]
[-OutputProfile <Faithful| Lightweight| PrintReady| TextOnly>]
[-Password <SecureString>]
[-PasswordVariable <String>]
[-Path] <String[]>
[-PdfPasswordVariable <String>]
[-Plan]
[-Recurse]
[-ReportPath <String>]
[-Resume]
[-RetryFailed]
[-Route <String>]
[-SaveJob <String>]
[-SkipUpToDate]
[-SummaryVariable <String>]
[-ThrottleLimit <Int32>]
-To <String>
[<CommonParameters>]#Parameter set:
PathConvert-OfficeDocument
[-AllowEmpty]
-JobPath <String>
[-Plan]
[-ReportPath <String>]
[-RetryFailed]
[-SummaryVariable <String>]
[<CommonParameters>]#Parameter set:
JobConvert-OfficeDocument
[-AllowEmpty]
[-AllowLegacyImportLoss]
[-AsString]
[-AutoRename]
[-CheckpointPath <String>]
[-CompressPdf]
[-Extension <String[]>]
[-FailOnLoss]
[-From <String>]
[-JobName <String>]
-LiteralPath <String[]>
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoClobber]
[-Options <Object[]>]
[-OutputDirectory <String>]
[-OutputProfile <Faithful| Lightweight| PrintReady| TextOnly>]
[-Password <SecureString>]
[-PasswordVariable <String>]
[-PdfPasswordVariable <String>]
[-Plan]
[-Recurse]
[-ReportPath <String>]
[-Resume]
[-RetryFailed]
[-Route <String>]
[-SaveJob <String>]
[-SkipUpToDate]
[-SummaryVariable <String>]
[-ThrottleLimit <Int32>]
-To <String>
[<CommonParameters>]#Parameter set:
LiteralPathConvert-OfficeDocument
[-AllowLegacyImportLoss]
[-AutoRename]
[-CompressPdf]
[-FailOnLoss]
[-From <String>]
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoClobber]
[-Options <Object[]>]
[-OutputPath] <String>
[-OutputProfile <Faithful| Lightweight| PrintReady| TextOnly>]
[-Password <SecureString>]
[-Path] <String[]>
[-Route <String>]
[-SkipUpToDate]
[-SummaryVariable <String>]
[-To <String>]
[<CommonParameters>]#Parameter set:
PathFileConvert-OfficeDocument
[-AllowLegacyImportLoss]
[-AutoRename]
[-CompressPdf]
[-FailOnLoss]
[-From <String>]
-LiteralPath <String[]>
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoClobber]
[-Options <Object[]>]
[-OutputPath] <String>
[-OutputProfile <Faithful| Lightweight| PrintReady| TextOnly>]
[-Password <SecureString>]
[-Route <String>]
[-SkipUpToDate]
[-SummaryVariable <String>]
[-To <String>]
[<CommonParameters>]#Parameter set:
LiteralPathFileConvert-OfficeDocument
[-AllowLegacyImportLoss]
[-AsString]
[-AutoRename]
[-CompressPdf]
[-FailOnLoss]
-From <String>
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoClobber]
[-Options <Object[]>]
[[-OutputPath] <String>]
[-OutputProfile <Faithful| Lightweight| PrintReady| TextOnly>]
[-Password <SecureString>]
[-Route <String>]
[-SummaryVariable <String>]
[-Text] <String>
-To <String>
[<CommonParameters>]#Parameter set:
TextConvert-OfficeDocument
[-AllowLegacyImportLoss]
[-AsString]
[-AutoRename]
[-CompressPdf]
[-Document] <Object>
[-FailOnLoss]
[-From <String>]
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoClobber]
[-Options <Object[]>]
[[-OutputPath] <String>]
[-OutputProfile <Faithful| Lightweight| PrintReady| TextOnly>]
[-Password <SecureString>]
[-Route <String>]
[-SkipUpToDate]
[-SummaryVariable <String>]
[-To <String>]
[<CommonParameters>]#Parameter set:
DocumentDescription
Writes each completed file's conversion evidence as it finishes. Paths resolve through the FileSystem provider before background execution; LiteralPath preserves wildcard characters. Saved jobs use the same contract as Studio and the CLI.
Examples
Convert one document to PDF.
Convert-OfficeDocument -Path ./report.docx -OutputPath ./report.pdfConvert a file pipeline and retain complete batch counts.
Get-ChildItem ./reports -Filter *.docx | Convert-OfficeDocument -To Pdf -OutputDirectory ./pdf -SummaryVariable summary
$summarySave and preview a portable conversion job.
Convert-OfficeDocument -Path ./reports -Recurse -To Pdf -OutputDirectory ./pdf -SaveJob ./reports.officejob.json
Convert-OfficeDocument -JobPath ./reports.officejob.json -PlanParameters
- -AllowEmpty SwitchParameter
- Accept an intentionally empty selection without an error.
- -AllowLegacyImportLoss SwitchParameter
- Explicitly accept the native legacy Word importer's reported reductions.
- -AsString SwitchParameter
- Return converted text to the pipeline instead of publishing a main output file.
- -AutoRename SwitchParameter
- Choose a unique destination name when the requested output exists.
- -CheckpointPath String
- Checkpoint manifest file. With Resume, defaults to .officeimo-batch.json in the output folder.
- -CompressPdf SwitchParameter
- Apply verified lossless compression to PDF output.
- -Extension String[]
- Select these source extensions from directories.
- -FailOnLoss SwitchParameter
- Reject a conversion that reports fidelity loss before publishing its output.
- -From String
- Source format family or exact codec extension. Overrides filenames while retaining their physical source identity.
- -JobName String
- Display name stored in the saved definition.
- -MaximumFiles Int32
- Maximum discovered files, including skipped inputs; zero selects the largest supported bound.
- -MaximumInputBytes Int64
- Maximum source bytes per file.
- -MaximumOutputBytes Int64
- Maximum serialized output bytes per file.
- -MaximumXmlCharactersInPart Int64
- Maximum XML characters in one package part.
- -NoClobber SwitchParameter
- Leave an existing destination unchanged and report its input as skipped.
- -Options Object[]
- Format-owned settings, typed conversion options, or property hashtables.
- -OutputDirectory String
- Destination folder for a batch.
- -OutputProfile OfficeConversionProfile
- Output intent, subject to the selected route's supported profiles.
- Possible values:
Faithful,Lightweight,PrintReady,TextOnly - -Password SecureString
- Runtime source password; saved definitions contain references rather than password values.
- -PasswordVariable String
- Admitted environment-variable reference for source passwords in a saved job.
- -Path String[]
- Input files or folders, with FileSystem provider wildcard expansion. Piped paths with OutputPath bind through Document.
- -PdfPasswordVariable String
- Separate environment-variable reference for PDF source passwords in a mixed-format job.
- -Plan SwitchParameter
- Preview selected inputs and proposed destinations without output or checkpoint writes.
- -Recurse SwitchParameter
- Traverse child directories when selecting a folder.
- -ReportPath String
- New durable run report outside the source, output, checkpoint and job trees.
- -Resume SwitchParameter
- Continue a checkpointed batch, verifying completed output hashes before reuse.
- -RetryFailed SwitchParameter
- Retry failed checkpoint items while retaining verified completed outputs.
- -Route String
- Exact executable route identifier from Get-OfficeDocumentCapability -Conversion.
- -SaveJob String
- Save the portable batch definition instead of executing it; returns its FileInfo.
- -SkipUpToDate SwitchParameter
- Skip a file whose existing output has a strictly newer UTC modification time.
- -SummaryVariable String
- Final batch counts or single-file evidence assigned before any terminal batch error.
- -ThrottleLimit Int32
- Maximum simultaneous conversions.
- -To String
- Target format family, such as Pdf or Word, or an exact physical extension, such as .doc or .docx. Optional when OutputPath names the target.
- -JobPath String
- Portable job definition to run or preview; relative paths resolve against this file.
- -LiteralPath String[]
- Input files or folders without wildcard expansion; accepts FileInfo.FullName and provider PSPath.
- -OutputPath String
- Single-file destination. Its extension selects the target when To is omitted.
- -Text String
- Literal source content, interpreted according to From rather than as a filename.
- -Document Object
- Caller-owned live document. Conversion captures current edits without saving or closing its source. Piped FileInfo objects and path strings convert as files.
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.