Public/Invoke-ZipDirectory.ps1

function global:Invoke-ZipDirectory
{
        <#
            .EXTERNALHELP HelperFunctions.psm1-Help.xml
        #>

    
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true,
                 ValueFromPipeline = $true,
                 HelpMessage = 'Name of directory containing files to zip.')]
        [String]$SourceDir,
        [Parameter(Mandatory = $true,
                 ValueFromPipeline = $true,
                 HelpMessage = 'Name of archive file to create.')]
        [String]$ZipFileName
        
    )
    
    begin
    {
        Add-Type -Assembly System.IO.Compression.FileSystem
    }
    process
    {
        [System.IO.Compression.ZipFile]::CreateFromDirectory($SourceDir, $ZipFileName, $CompressionLevel, $false)
    }
} #End function Invoke-ZipDirectory