Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Repair-OfficeDocument

Module
PSWriteOffice
Inputs
System.Object System.String[]
Outputs
PSWriteOffice.Models.OfficeRepairReport

Runs native workbook repairs in place, into a copy, or on a caller-owned model.

Syntax

Repair-OfficeDocument
[-Options <Object[]>]
[-OutputPath <String>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[<CommonParameters>]
#
Parameter set: Path
Repair-OfficeDocument
-LiteralPath <String[]>
[-Options <Object[]>]
[-OutputPath <String>]
[-PassThru]
[-Password <SecureString>]
[<CommonParameters>]
#
Parameter set: LiteralPath
Repair-OfficeDocument
[-Document] <Object>
[-Options <Object[]>]
[-OutputPath <String>]
[-PassThru]
[<CommonParameters>]
#
Parameter set: Document

Examples

Example 1

Repair-OfficeDocument -Path @('C:\Path')

Example 2

Repair-OfficeDocument -Document 'Value'

Example 3

Repair-OfficeDocument -LiteralPath @('C:\Path')

Parameters

-Options Object[] optional
Native format repair settings and property overrides.
-OutputPath String optional
Write one repaired copy; file inputs otherwise save in place.
-PassThru SwitchParameter optional
Emit native repair findings and publication details.
-Password SecureString optionalsets: Path, LiteralPath
Password used to open an encrypted file.
-Path String[] requiredposition: 0pipeline: True (ByValue)sets: Path
Input paths; supports wildcards.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Exact input paths.
-Document Object requiredposition: 0pipeline: True (ByValue)sets: Document
Caller-owned native document to repair without taking ownership.

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.

Outputs

PSWriteOffice.Models.OfficeRepairReport: Native workbook repair findings and the destination actually published by Repair-OfficeDocument.