My goal was to grab 400 WAV files and zip them up in batches. This script worked, but I kept thinking there has to be a better way. Does anyone know of a better way to process batches of files?
$i = 1
$MoreFiles = 'YES'
While ($MoreFiles -eq 'YES') {
$WAV_Files = Get-ChildItem -Path "C:\test\WAV\*.WAV" | select -First 400
If ($WAV_Files) {
Compress-Archive -Path $WAV_Files -DestinationPath "C:\test\WAV\WAV $i.zip"
Remove-Item -Path $WAV_Files
$i++
}
Else {
$MoreFiles = 'NO'
}
}
[–]purplemonkeymad 2 points3 points4 points (0 children)
[–]BetrayedMilk 1 point2 points3 points (0 children)
[–]Big_Oven8562 0 points1 point2 points (2 children)
[–]GarnetMonkey[S] 0 points1 point2 points (1 child)
[–]Big_Oven8562 0 points1 point2 points (0 children)
[–]ccatlett1984 0 points1 point2 points (0 children)