0

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

  • 2
    You want to use a condition here before your final output. You need a `where {$_.CreationTime.Date -eq $today} ` condition. It ***is okay*** to chain `where` commands – AdminOfThings Feb 11 '20 at 09:30

1 Answers1

1
$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}
}
t1meless
  • 504
  • 2
  • 9