Expand-Zip Cmdlet
Parameters Output Objects Configuration Settings
The Expand-ZIP cmdlet implements a decompressor for ZIP, GZIP, JAR, and TAR archives.
Syntax
Expand-Zip [parameters]
Remarks
The format for decompression is specified by the Format parameter.
To scan an archive, set the Input parameter to the archive to examine, and set the Format parameter to the appropriate type. A ZipFileInfo object will be returned for every entry in the archive.
If the Output parameter is set, the cmdlet will attempt to extract the archive to the specified location. A single ZipFileInfo object will be returned indicating the success of the operation and the number of extracted files.
For the Zip format, the cmdlet uses the Deflate algorithm specified in RFC 1951 for decompression, and reads output compatible with PKZip, WinZip, etc.
For Gzip, the cmdlet component implements a gzip decompressor compliant to RFC 1952 and compatible with the UNIX gzip and gunzip utilities.
For Jar files, the operation of the cmdlet is similar to that of the Zip format.
The Tar files, the cmdlet implements a tar archive utility, compatible with the UNIX tar and untar utilities. The interface is identical to that of the Zip format and is the same whether gzip compression is used or not, so the Tar Format can be used for both .tar and .tgz archives.
The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.
# scan a jar file
Expand-Zip -Input
"simple.jar"
-Format
"jar"
# extract files from a zip archive
Expand-Zip -Input
"C:\temp.zip"
-Password
"mypassword"
-Output
"C:\temp"
# extract files from a tar-gzip archive
Expand-Zip -Input
"C:\sample.tgz"
-Format
"tar"
Parameter List
The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.
LogFile | The location of a file to which debug information is written. |
Config | Specifies one or more configuration settings. |
ExcludedFiles | A list of files to exclude. |
Format | The format of the compression used. |
IncludedFiles | Specifies that only files matching the provided values should be extracted. |
Input | The archive file from which to read. |
LogFile | The location of a file to which debug information is written. |
Output | The directory where the files will be decompressed. |
Overwrite | Whether or not to overwrite files when writing to them. |
Password | The password for the zip archive. |
Recurse | Whether or not to recurse into subdirectories. |
Output Objects
The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.
ZipFileInfo | Information about the entries in the archive. |
Configuration Settings
The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.
UseBackgroundThread | Whether threads created by the cmdlet are background threads. |
UseInternalSecurityAPI | Tells the cmdlet whether or not to use the system security libraries or an internal implementation. |