I am currently writing a PowerShell script which looks for servers on an Azure Backup Vault. I am in need of estimating the size of every backup sent, but sadly haven’t found an efficient way to do it. As the directory doesn’t have a value for their ItemSize property, I need to get accumulate the size of every file in the backup.
I am currently browsing each file individually by browsing them with: New-OBPagingContext | Get-OBRecoverableItem –ParentItem $parentItem I then add the size of every file.
The problem is that it is super inefficient and takes hours for small volumes. I also found out that I can use this: $allFiles = Get-OBRecoverableItem –SearchString “*” –Location “C:\” –RecoveryPoint $parentItem to find every file, but the cmdlet seems to max out after finding 2000 files which isn’t helping at all. However, this method is infinitely faster and gives a result within seconds.
Is there any way to bypass the limit of 2000 items or any other way of estimating the size of a backup?