PowerShell: Create Archive zip, tar, 7z

By Xah Lee. Date: .

Create Zip Archive

Compress-Archive c:/Users/xah/Pictures/ c:/Users/xah/pic.zip

Note: the max zip file Compress-Archive can create is 2 GB. As of 2021-11-07. See help Compress-Archive

Use 7z instead.

Create Tar Archive

Windows 10 has BSD tar builtin, at C:/Windows/system32/tar.exe

# create tar file
tar cvf dirname.tar dirname

tar -h for help. For more detail see Linux: untar unzip gunzip unrar etc

Create 7z archive

7z a c:/Users/xah/Pictures.7z c:/Users/xah/Pictures/
7z a c:/Users/xah/Pictures.zip c:/Users/xah/Pictures/

PowerShell zip tar

PowerShell

Practical How-To

list files

list dirs

on dir

on file

Windows config

zip tar

misc


PowerShell in Depth

Programing PowerShell

Value Types

String

Variable

Boolean

Conditional

Data Structure

Loop and Iteration

Input/Output

Function

Profile and Script

Script Examples