Learn how to create zip files and unzip archive files using simple PowerShell commands in Windows 11 and Windows 10.
To make sharing multiple files easy or to save disk space, you can compress them into a zip file. Generally, we use the File Explorer options to create and extract zip archive files. All you have to do is right-click on the file and select “Compress to” > “ZIP”. If needed, you can always add more files to the ZIP archive. Alternatively, you can quickly and easily compress and decompress files using PowerShell. This is very helpful for creating your own scripts or when working in the command line.
In this quick and straightforward tutorial, let me show you the steps to zip and unzip files using PowerShell in Windows 11 and Windows 10. Let’s get started.
Before You Start
- The steps below have been tested to work on Windows 11 and Windows 10.
How To Create a ZIP Archive for an Individual File Using PowerShell
To compress a file and create a zip archive using PowerShell, we’ll use the built-in Compress-Archive cmdlet. Here’s how.
- Open the Start menu by pressing the Windows key on your keyboard.
- Type “PowerShell” and press “Enter” to launch it.
- Run the below command to zip the file and create an archive. Replace <FilePath> with the full path to the file you want to compress (e.g., “C:\Documents\MyReport.docx”) and <DestinationArchive.zip> with the full path and filename for the new ZIP archive (e.g., “D:\Backups\MyReport_Backup.zip”).
Compress-Archive -LiteralPath '<FilePath>' -DestinationPath '<DestinationArchive.zip>' - As soon as you execute the command, PowerShell will zip the file and save it in the specified destination with the specified name.

- You can close the PowerShell window.
Good to know: How to create tar and 7z archive using PowerShell
How To Zip an Entire Folder Using PowerShell
To compress a folder using PowerShell, follow the steps below.
- Open the Start menu by pressing the “Windows key” on your keyboard.
- Search for PowerShell and open it.
- Run the below command to zip the folder and create an archive. Replace <FolderPath> with the full path to the file you want to compress (e.g., “C:\Documents\MyFolder”) and <DestinationArchive.zip> with the full path and filename for the new ZIP archive (e.g., “D:\Backups\MyFolder_Backup.zip”).
Compress-Archive -LiteralPath '<FolderPath>' -DestinationPath '<DestinationArchive>' - Depending on the folder size or the number of files, it will take some time to complete the compression process.

- Once done, close the PowerShell window.
You will find the compressed zip file in the destination you set in the above command.
How to Extract / Unzip Files Using PowerShell
Just as you can compress files with PowerShell, you can also extract archives with PowerShell’s Expand-Archive cmdlet. Here’s how.
- Click the “Windows key” on the taskbar to open the Start menu.
- Search for “PowerShell” and click “Open“.
- Run the following command while replacing <ZipFilePath> and <DestinationPath> with the actual zip file path and destination folder path where you want the archive to be extracted, respectively.
Expand-Archive -LiteralPath <ZipFilePath> -DestinationPath <DestinationPath> - Once extracted, close the PowerShell window.

Note: Depending on the archive size and compression settings, it will take some time to fully extract an archive. Wait until the decompression process is completed.
You will find the extracted files in the folder given in the destination path.
Good to know: How to unzip / decompress .tar.gz, .tgz, .gz files on Windows 11
—
That is all. It is that simple to Zip and Unzip archive files using PowerShell on Windows 11 and Windows 10.
If you have any questions or need help, comment below. I’ll be happy to assist.