Cmdlet
Expand-OfficeArchive
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 SetsDescription
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[]
- Additional volume paths in archive order. Multiple paths default to RAR5 when VolumeFormat is omitted.
- -Destination String
- Path to a directory that does not exist or is empty. Extraction rejects a nonempty directory.
- -Entry String[]
- 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
- Literal path to the archive or its first volume.
- -Options ArchiveExtractionOptions
- Finite extraction limits, optional ZIP and 7z passwords, and opt-in passive prefix limits.
- -VolumeFormat ArchiveFormat
- Container format for explicitly supplied volumes. Omit for automatic detection of a single archive.
- Possible values:
Zip,SevenZip,Cab,RarLegacy,Rar5 - -WhatIf SwitchParameter
- Shows what would happen if the command runs.
- -Confirm SwitchParameter
- 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.