How can I create a tar archive file using PowerShell?

Problem:

How can I create a tar archive file using PowerShell?

Solution:

#create a testfile.tgz from the C:\Test folder and all files in it

tar -cvzf c:\temp\testfile.tgz C:\Test

# decompress a file called testfile.tgz into a folder called C:\Temp

tar -xvzf c:\temp\testfile.tgz -C C:\Temp

Leave a Reply

Your email address will not be published. Required fields are marked *