compress-archive using lot of memory
# File or directory to zip
$sourcePath = "C:\Path\To\File"
# Resulting .zip file
$destinationPath = "C:\Path\To\File.zip"
# Compression level. Optimal means smallest size, even if it takes a little longer to compress
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
# Whether or not to include root directory (if zipping a directory) in the archive
$includeBaseDirectory = $false
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory("$sourcePath","$destinationPath",$compressionLevel,$includeBaseDirectory)