PowerShell zip files and folder

In the PowerShell window, type in the following command:

Make sure to change to the actual path of the file you want to zip and with the location where you want to save the file.

Compression Level

There are three types of compression level.

  • Fastest − Uses the fastest compression to reduce the processing time. It can lead to larger file size.
  • Optimal − Normal compression level. Processing time depends on the size of the file. This is the default compression level if you don’t use the compression parameter.
  • NoCompression − Doesn’t compress the source files. This means the size of the actual folders and files are the same after the zipped only there is no compression ratio.

Compress files to create an archive file

*.vsd is wildcard here for multiple files with the same extension.

compress Root directory and below sub-directories and files

compress all the files and sub-directories below the root “SourceLocation” folder

compress only the files in the “SourceLocation” folder.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Notify of
Newest Most Voted
Inline Feedbacks
View all comments
2 months ago

Hi Arjun

Great article, I have a question. Hope you can answer. Here’s my code that zips all the folders into a single folder.

What I want to do it to copy this zip folder and send it to a shared network network location which should be a parameter.

I've tried many different stuff but haven't gone through yet. I just tried:

1 month ago
Reply to  Arjun

Thanks for the reply Arjun, I figured it out.

DMCA.com Protection Status
Would love your thoughts, please comment.x