How can I create a PowerShell script to compress files in a specific folder?
How can I create a PowerShell script to compress files in a specific folder?
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")