This backup takes place once a weekend on a USB drive. Before the backup starts, it should simply delete the backup from the previous week.
I created a Powershell script that I run directly from the backup task (USB Backup => Storage => Advanced => Scripts => Run the following script before the job).
The Powershell script has the following content:
Code: Select all
Get-VBRBackup -Name "USB-Backup" | Remove-VBRBackup -FromDisk -Confirm:$false
However, when I start the backup job, Veeam says the job ran correctly, but the previous week's backup is not deleted.
I've already put the whole thing into a batch file but without success.
What am I doing wrong?