Welcome to ciysys blog

Compress and decompress file

Published on: 25th Nov 2019

Updated on: 16th Jan 2022

Explanation

To compress and decompress files in Powershell is quite straightforward.

#compress "test" folder
Compress-Archive -Path "D:\temp3\test" -DestinationPath "D:\temp3\myFirstZipFile.zip"

#decompress the file to the "testFolder" folder.
Expand-Archive -Path "D:\temp3\myFirstZipFile.zip" -DestinationPath "d:\temp3\testFolder"

Use case

Jump to #POWERSHELL blog

Author

Lau Hon Wan, software developer.