$today = (get-date).Date
$backup = Get-VBRBackup | where {$_.info.jobname -eq "Name of Backup Job"}
if ($backup) {
$backup.GetAllStorages() | where {$_.CreationTime.Date
#-eq $today
} | select {$_.PartialPath}, {$_.Stats.BackupSize/1GB}, {$_.CreationTime}
}
In the sample it shows the size of all the Backups and their date, but I would like to know how to add more data, but I cannot find any more example variables of the mode:
Just pipe the results of Get-VBRBackup to Get-Member, you will see other properties that are objects with additional properties.
If you are having problems understanding this, install the PowerShell cookbook module from the PSGallery and pipe the results of Get-VBRBackup to Show-Object. That tool will give you a tree view of the properties and sub-properties.
This will show you the properties of the backup where you can start to look for the properties that you need
If you get stuck, you can also search the PowerShell forum for those terms for examples within other scripts to learn where to find that data within the object.
DirPath property you added to your script is a property of CBackup object you retrieve with Get-VBRBackup cmdlet.
In your script, as soon as you call $backup.GetAllStorages(), you start to work with CStorage object, which doesn't have DirPath property.
So, you need to call DirPath on $backup variable, which contains CBackup object:
Like Joe, I'd recommend to install Powershell Cookbook module and pipe the cmdlets you need to Show-Object to get acquainted with objects and their properties
in a more convenient way: