Zipping Files Through JAMS

Follow

There are a few ways to zip files through JAMS. A Workflow Job has an activity called ZipFiles which can be used to zip files. You can also use PowerShell, but for this approach you will need to have PowerShell version 3 as well as .Net 4.5 on the machine where the Job will run. Below is a PowerShell example:


 

$path = "D:\Temporary\"
$zipFileName = "D:\Temporary\MyZippedFiles.zip"

# Load the assembly to use for Zipping files
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")

# Get the Optimal CompressionLevel enum
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal

# Perform the Zip operation
[System.IO.Compression.ZipFile]::CreateFromDirectory($path,$zipFileName, $compressionLevel, $false)


Have more questions? Submit a request

Comments