Using PowerShell to ZIP something.

powershellI needed to ZIP-up some log files in a number of subdirectories.  In the past, I have used the PKZIP utility.

I couldn’t find my copy of PKZIP Sad smile

“Doesn’t PowerShell have a compress-archive command?”
’Why, yes it does!’

Two commands later:

$files=get-childitem *.log -Recurse
compress-archive $files -DestinationPath c:\data\AllTheLogFiles

I had my AllTheLogFiles.Zip file.