How can I create a PowerShell script to get all files of type .BAK and add them to a ZIP file (can I have my PowerShell script take a parameter when called to control the name o
You name the archive after each file you're processing in the loop, hence each file goes into its own archive. If you want to put all files into the same archive, define the archive name once outside the loop:
$zipfile = Join-Path $filePath 'v4.14.4_backups.zip'
foreach ($file in $bak) {
sz a -t7z $zipfile $file.FullName
}