powershell compress-archive code example
Example 1: powershell zip multiple files
Compress-Archive -Path C:\Reference -DestinationPath C:\Archives\Draft.zip
Example 2: powershell zip multiple files
$compress = @{
Path = "C:\Reference\Draftdoc.docx", "C:\Reference\Images\*.vsd"
CompressionLevel = "Fastest"
DestinationPath = "C:\Archives\Draft.Zip"
}
Compress-Archive @compress
Example 3: Compress files powershell
Compress-Archive -Path (Join-Path $filesDir "*.*") -DestinationPath (Join-Path $outDir "Files_Compressed.zip")
Example 4: Compress files powershell
Compress-Archive
Expand-Archive