Compress-SevenZip Cmdlet
Parameters Output Objects Configuration Settings
The Compress-SevenZip cmdlet implements a compressor for SevenZip files.
Syntax
Compress-SevenZip [parameters]
Remarks
The Input parameter should be set to the list of files/folders to include in the archive. The Output parameter should be set to the name and file path of the resulting archive.
To secure the archive with password-protected encryption, simply set the Password parameter.
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.
# compress the contents of a single folder
Compress-SevenZip -Input C:\temp -Output C:\temparchive.7z -Recurse
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. |
CompressionLevel | The compression level. |
CompressionMethod | The method of compression. |
Config | Specifies one or more configuration settings. |
FileCompressedName | Specifies the path and filename of the file in the archive. |
Input | The files to be included in the archive. |
LogFile | The location of a file to which debug information is written. |
Output | The archive file. |
Overwrite | Whether or not to overwrite the archive. |
Password | The password for the 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.
SevenZipFile | Returned after creation of a sevenzip file. |
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. |