# Expand-OfficeArchive

Extracts verified archive members to a new or empty directory.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Archives.ArchiveExtractionResult`

**Source**

[ExpandOfficeArchiveCommand.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Archive/ExpandOfficeArchiveCommand.cs#L18) 

Extracts verified archive members to a new or empty directory.

## Syntax

```
Expand-OfficeArchive
[-AdditionalVolume <String[]>]
-Destination <String>
[-Entry <String[]>]
[-LiteralPath] <String>
[-Options <ArchiveExtractionOptions>]
[-VolumeFormat <Zip|SevenZip|Cab|RarLegacy|Rar5>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-expand-officearchive-string-string-string-string-archiveextractionoptions-archiveformat-switchparameter-switchparameter)

Parameter set: `All Parameter Sets`

## Description

The archive engine verifies the selected content before publishing the directory. Use -WhatIf to preview publication or -Confirm to request confirmation before extraction. Select members by their portable relative names. The result's Files collection lists the files that were published.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Reliable Automation Patterns](/docs/pswriteoffice/automation-patterns/) Guide
  
  Structure document jobs for repeatability, diagnostics, safe mutation, and CI artifacts. Includes examples and cmdlet links.
- [PSWriteOffice Command Families](/docs/pswriteoffice/command-families/) Guide
  
  The generated map of all exported cmdlets and the conceptual guide for each family. Includes PowerShell examples, validation notes, and cmdlet links.

## Examples

### Extract two named ZIP members to a new folder.

```powershell
Expand-OfficeArchive -LiteralPath ./documents.zip -Destination ./unpacked -Entry 'one.txt','notes/two.txt'
```

### Extract a member from an ordered split ZIP.

```powershell
Expand-OfficeArchive -LiteralPath ./documents.z01 -AdditionalVolume ./documents.z02,./documents.zip -VolumeFormat Zip -Destination ./unpacked -Entry 'report.pdf'
```

## Parameters

**-AdditionalVolume String[] optional**

Additional volume paths in archive order. Multiple paths default to RAR5 when VolumeFormat is omitted.

**-Destination String required**

Path to a directory that does not exist or is empty. Extraction rejects a nonempty directory.

**-Entry String[] optional**

One or more portable relative file paths. Use forward slashes even on Windows, for example reports/monthly.csv. Matching is exact and case-sensitive. Names with no match are skipped. The extractor validates every discovered member path before applying this filter, including unselected members. When Options also selects files, both filters must match. Extraction fails when a selected member has an unsupported type. To skip TAR symbolic links with valid member names, list the regular files explicitly.

**-LiteralPath String requiredposition: 0**

Literal path to the archive or its first volume.

**-Options ArchiveExtractionOptions optional**

Finite extraction limits, optional ZIP and 7z passwords, and opt-in passive prefix limits.

**-VolumeFormat ArchiveFormat optional**

Container format for explicitly supplied volumes. Omit for automatic detection of a single archive.

Possible values: `Zip`, `SevenZip`, `Cab`, `RarLegacy`, `Rar5`

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:9DB89ABFFAED02B6BC490EB23EAD9E94FE05CB9E8E19BEAD50CC820617EA0F38 -->
