How to Extract a Zip File Using PowerShell in Windows 11
Extracting a zip file from PowerShell unpacks its contents into a folder you choose, which is convenient in scripts or when working in a terminal. Windows 11 includes this without needing any third-party unzip tool.
The Command
Expand-Archive -Path "C:\Archive.zip" -DestinationPath "C:\Extracted"
What It Does
`Expand-Archive` unpacks a zip file. The `-Path` points to the zip archive, and `-DestinationPath` is the folder where the contents will be placed. If that folder does not exist, PowerShell creates it. After running, the Extracted folder holds everything that was inside the archive, with any internal folder structure YYGACOR preserved.
When You’d Use This
This is what you need when you receive a zip file and want its contents in a folder, especially in scripts that download and unpack archives automatically. Since it is built into Windows 11, no separate unzip tool is required. It preserves any folder structure inside the archive, recreating the original layout in your chosen destination.
Useful Variations
To extract into the current folder, set the destination to a folder name without a full path. To overwrite files if the destination already contains them, add `-Force`. If you only need to see what an archive contains without extracting, other tools or a brief script can list its entries, but extraction is the direct approach.
If It Doesn’t Work
If extraction stops because files already exist, add `-Force` to overwrite them. If the destination runs out of room, free up space, since the extracted contents need as much room as their uncompressed size. A corrupted or incomplete archive causes errors, so re-download the zip if it will not open, and confirm the archive path is correct if the file is not found.
Good to Know
If the destination folder already contains files with the same names, the command stops unless you add `-Force` to overwrite them. Extracting large archives uses disk space equal to the uncompressed contents, so make sure the target drive has enough free space.
Putting It Together
The command shown may look dense at first, but it breaks down into clear parts once you have used it a few times. As part of managing files from the terminal, this command earns its place once you are comfortable working without File Explorer. Combined with the others in this area, it lets you handle files in bulk and in scripts far faster than clicking through folders. Like anything in the terminal, the real value comes from trying it on your own system and adapting the variations above to what you actually need, so it is worth experimenting with in a safe, low-stakes situation before relying on it in a script or during troubleshooting. Keeping a note of the commands you find most useful, along with the variations that fit your workflow, turns scattered one-off tricks into a personal reference you can draw on whenever a similar task comes up again.