SID-500

Home » PowerShell » Use PowerShell to create compressed ZIP files

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

unbenannt

Compress-Archive compresses data.

Compress-Archive -Path C:\Temp\* -DestinationPath C:\Temp\Compressed.zip

Unbenannt.PNG

The ZIP File was generated.

Unbenannt.PNG

Expand-Archive decompresses the files.

Expand-Archive -Path C:\Temp\Compressed.zip -DestinationPath C:\Temp\

Unbenannt.PNG

Further thoughts

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


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

GET-AUTHOR

My name is Patrick Grünauer. Microsoft MVP. I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Categories

Patrick Gruenauer
Follow SID-500 on WordPress.com