Cmdlet
Compare-OfficeWordDocument
Compares two Word documents and optionally writes a tracked-change redline.
Syntax
Compare-OfficeWordDocument [-DifferencePath] <String> [-Options <WordComparisonOptions>] [-RedlinePath <String>] [-ReferencePath] <String> [<CommonParameters>]#Parameter set:
All Parameter SetsExamples
Create a structured comparison and redline.
$result = Compare-OfficeWordDocument -ReferencePath .\Before.docx -DifferencePath .\After.docx -RedlinePath .\Redline.docxReturns deterministic findings and saves a Word document containing revision marks.
Ignore whitespace and volatile metadata.
$options = New-OfficeWordComparisonOptions -IgnoreWhitespace -CompareVolatileMetadata:$false
Compare-OfficeWordDocument -ReferencePath .\Before.docx -DifferencePath .\After.docx -Options $optionsParameters
- -DifferencePath String
- Path to the modified Word document.
- -Options WordComparisonOptions
- Optional structural comparison switches.
- -RedlinePath String
- Optional path for a tracked-change redline document.
- -ReferencePath String
- Path to the original Word document.
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.