Cyber Security

Use PowerShell to create compressed ZIP files

With PowerShell 5.0 two new commands are introduced: Compress-Archive and Expand- Archive. The commands compress and decompress data.

Get-Command -Noun Archive


Compress-Archive compresses data.

Compress-Archive -Path C:\Temp\* -DestinationPath C:\Temp\


The ZIP File was generated.


Expand-Archive decompresses the files.

Expand-Archive -Path C:\Temp\ -DestinationPath C:\Temp\


Further thoughts

If you can´t do without WinZip, I recommend my article Package Management in PowerShell (Chocolatey)

2 replies »

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.