Search code examples
powershellshellscriptingveeam

Powershell - How to show only today files


I am dealing with this little script, which shows me the latest data from a Veeam Software job.

$today = (get-date).Date
(Get-VBRBackup | where {$_.info.jobname -eq "A. ProduccionInterna.Infraestructura"}).GetAllStorages() | select {$_.PartialPath}, {$_.Stats.BackupSize/1GB}, {$_.CreationTime.Date -eq $today} 

But it shows me all the existing results, not only those of the last day that would be the ones that interest me

Thanks for the help


Solution

  • $today = (get-date).Date
    $backup = Get-VBRBackup | where {$_.info.jobname -eq "A. ProduccionInterna.Infraestructura"}
    if ($backup) {
        $backup.GetAllStorages() | where {$_.CreationTime.Date -eq $today} | select {$_.PartialPath}, {$_.Stats.BackupSize/1GB}
    }