Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Expand-OfficeArchive

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Archives.ArchiveExtractionResult

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>]
#
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.

Examples

Extract two named ZIP members to a new folder.

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

Extract a member from an ordered split ZIP.

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.