A simple zip function in Powershell

function ZipFiles($ZipFileName, $SourceDir)
{
    Add-Type -Assembly System.IO.Compression.FileSystem
    $compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
    [System.IO.Compression.ZipFile]::CreateFromDirectory($SourceDir, $ZipFileName, $compressionLevel, $false)
}

To use the function:

ZipFiles -ZipFileName test.zip -SourceDir .\folder\to\zip
---
If you have any questions or feedback, please reach out @flowerinthenyt.