Share via


ExtractFiles@1 - Extract files v1 task

Use this task to extract a variety of archive and compression files, such as .7z, .rar, .tar.gz, and .zip.

Inputs

archiveFilePatterns - Archive file patterns
string. Required. Default value: *.zip.

Specifies the file paths or patterns of the archive files to extract. Supports multiple lines of minimatch patterns. Learn more about the Extract Files task.


destinationFolder - Destination folder
string. Required.

Specifies the destination folder into which archive files should be extracted. Use variables if files are not in the repo. For example: $(agent.builddirectory).


cleanDestinationFolder - Clean destination folder before extracting
boolean. Default value: true.

Specifies the option to clean the destination directory before archive contents are extracted into it.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Use this task to extract files from archives to a target folder using match patterns. A range of standard archive formats is supported, including .zip, .jar, .war, .ear, .tar, .7z, and more.

For more information about file matching patterns, see the File matching patterns reference.

Examples

Extract all .zip files recursively

This example will extract all .zip files recursively, including both root files and files from sub-folders.

steps:
- task: ExtractFiles@1
  inputs:
    archiveFilePatterns: '**/*.zip'
    cleanDestinationFolder: true
    overwriteExistingFiles: false

Extract all .zip files from subfolder

This example will extract test/one.zip and test/two.zip, but will leave test/nested/three.zip.

steps:
- task: ExtractFiles@1
  inputs:
    archiveFilePatterns: 'test/*.zip'
    cleanDestinationFolder: true
    overwriteExistingFiles: false

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Utility

See also