PowerShell cheat sheet.
Zip all log files (*.log) in folder:
*.log
1 2 3 4 5 6
Get-ChildItem -Path . -Filter *.log | ForEach-Object { Write-Output $_.FullName $zip = $_.BaseName + ".zip" Compress-Archive -Path $_.FullName -DestinationPath $zip -Force Remove-Item $_.FullName }