Compress Files in PowerShell

2

How can I create a PowerShell script to compress files in a specific folder?

    
asked by anonymous 19.01.2018 / 13:04

1 answer

2

Using Compress-Archive

Compress-Archive C:\Origem -DestinationPath ('C:\Destino\arquivo.zip')

Or by using the ZipFile > of the .NET Framework

Add-Type -Assembly "System.IO.Compression.FileSystem"
[System.IO.Compression.ZipFile]::CreateFromDirectory("C:\Origem", "C:\Destino\arquivo.zip")

I added the two scripts in GitHub for future reference.

    
19.01.2018 / 13:18