Using PowerShell, I need to be able to report not only the FileShare license consumption, but also how much capacity on disk is being consumed by the secondary destinations. I am setting up a test customer, so that I can work out how to do the reporting. This test customer has 11 Azure Files shares being backed up in the single backup job, with the two secondary destinations configured.
I can work out the license instance consumption for each of the 11 shares and stick that into an array which allows me to easily sum the license usage of a file backup job (one file backup job equals one customer).
The bit I am stuck at is how to get the size of the backup data on disk? I've been looking into the Get-VBRNASBackupRestorePoint cmdlet but it doesn't seem to have any info about size on disk... none of the other cmdlets jump out as being especially useful to me.... how do I get the size of backup files on disk?
This is what I have so far:
Code: Select all
$FileBackupJobs = Get-VBRNASBackupJob
$FileShareLicenses = Get-VBRLicensedInstanceWorkload -License (Get-VBRInstalledLicense)
$FileShareLicenses = $FileShareLicenses | ? { $_.Type -eq 'FileShare' }
$Output = @()
foreach ($filejob in $FileBackupJobs) {
$objFileJob = [pscustomobject]@{
Name = $filejob.Name
Id = $filejob.Id
BackupObject = @()
}
foreach ($source in $filejob.BackupObject) {
$objSource = [pscustomobject]@{
Path = $source.Path
LicenseUsage = ($FileShareLicenses | ? { $_.Name -eq $source.Path }).UsedInstancesNumber
BackupSizeGB = 0
}
$objFileJob.BackupObject += $objSource
}
$Output += $objFileJob
}