This works great for me using forever forward incremental jobs. If you are using synthetic fulls, or reverse you may get unexpected results as your latest job will show as the full size.
I took my previous script and modified it so I can look at the previous 2 weeks, and see the size of the backup for each day. If you change the (-14) you can make this weekly, monthly, daily with ease.
1# Location of the Veeam backup folder2$BackupFolderPath = "f:\Backups"34# Start and end dates5$EndDate = Get-Date6$StartDate = $EndDate.AddDays(-14)78# Function to convert bytes to GB9function ConvertTo-GB {10 param (11 [Parameter(Mandatory=$true)]12 [int64]13 $bytes14 )15 return "{0:N2}" -f ($bytes / 1GB) + " GB"16}1718# Go through each day from the start date to the end date19for ($Date = $StartDate; $Date -le $EndDate; $Date = $Date.AddDays(1)) {20 # Date in the format 'yyyy-MM-dd'21 $DateString = $Date.ToString('yyyy-MM-dd')2223 # Get all backup files for this date24 $BackupFiles = Get-ChildItem -Path $BackupFolderPath -Recurse -Filter "*$DateString*"2526 # If there's no backup file for this date, continue to the next date27 if ($BackupFiles -eq $null) {28 Write-Output "No backup files for the date $DateString were found."29 continue30 }3132 # Sum up the sizes of all backup files for this date33 $TotalBackupSizeBytes = 034 foreach ($BackupFile in $BackupFiles) {35 $TotalBackupSizeBytes += (Get-Item $BackupFile.FullName).Length36 }3738 # Convert bytes to GB39 $TotalBackupSizeGB = ConvertTo-GB -bytes $TotalBackupSizeBytes4041 # Print the total size of the backup files for this date42 Write-Output "The total size of the backup files for the date $DateString is $TotalBackupSizeGB."43}44
