Scenario, you’re on a Windows Server and don’t want to or can’t install a zip program.
This script will help you create a zip file without any special program.
Caveat: Currently this does not give you any kind of status so it could seem to be doing nothing for a while depending on the size of the directory you want/need to compress.
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) } ZipFiles c:\Drivers.zip D:\