For VMs and NAS the following code seems to work. It gets that info you see in task as "used"

Code: Select all
$LastSession = $Job.FindLastSession()
$LastSessionTasks = Get-VBRTaskSession -Session $LastSession
$DATA_SIZE = 0
foreach ($Task in $LastSessionTasks) {
$DATA_SIZE += $Task.Progress.TotalUsedSize
}
But it just seems that there is nothing that one can do to get that info from agent based jobs.
Full backups report entire disk size as data size in session.
I started to think that maybe I just get last VBK file size, and multiple the size by some deduplication and compression info... but but even that info is not where one would expect it. Is there a way?