How can we, using powershell, positively identify a just-imported backup so we can then do something with that specific backup?
We receive 3rd party client backups and use powershell to import them into our own VBR for various purposes (run checks etc.).
When we import the backup the only thing we have is the path to the backup. With Veeam v11 and prior, we could then identify a specific imported backup using the path, e.g.:
Code: Select all
$dir = '\aaa\bbb'
$fname = 'ccc.vbm'
Import-VBRBackup -Server $host -Filename ($dir + '\' + $fname)
$b = Get-VBRBackup | ?{$dir -eq $_.DirPath -and $fname -eq $_.MetaFileName}
// do stuff with the $b backup
Veeam Advanced Technical Support have said this is "by design ... and can not be changed":
Case #06035136 - BUG importing vbm file with non-blank PolicyName
In our environment we have a number of backups imported at any time, we're not in control of the backup names, and we don't know the backup names (other than what might be "encoded" in the path), and it's not uncommon for multiple backups to have the same name (e.g. we receive a lot of backups called "Backup Copy Job"), and we may be importing multiple backups at the same time as a response to external events (i.e. we can't rely on "look at the existing backups, do an import, and the new backup is the one just imported").
So... how can our powershell positively identify a just-imported backup so it can then do whatever it needs with that specific backup?
(Ideally, Import-VBRBackup would return the handle to the just-imported backup but... it doesn't.

Cheers,
Chris