Commands / Files

Expand-Archive

Unzip a file

beginner Files

Expand-Archive
 Expand-Archive -Path .\docs.zip -DestinationPath .\docs-unzipped
Works on
WindowsLinuxmacOS
PowerShell
5.1 and later
Reference
Microsoft Learn: Expand-Archive

Extracts every file in a zip into the destination folder. The folder is created if it does not exist.

If a file is already there, the command stops with an error. Add -Force to overwrite.

Downloaded zips carry the "from the internet" mark, and so do the files inside them. If a script from the zip will not run, see Unblock-File.

Try this

Expand-Archive -Path .\docs.zip -DestinationPath .\docs-unzipped -Force
Get-ChildItem -Path .\docs-unzipped -Recurse

Coming from another shell

ShellWhat you might type
bash / zshunzip docs.zip -d docs-unzipped
cmd.exetar -x -f docs.zip -C docs-unzipped

More in From bash and From cmd.

Related commands