PowerShell script exchange
Post Reply
logicalbiz
Lurker
Posts: 1
Liked: never
Joined: Jun 15, 2010 11:52 pm
Full Name: Jay Horowitz
Contact:

Issue with Get-VBRJob return value LatestRunLocal PS vs interactive

Post by logicalbiz »

Hi

We have a script that was working on Veeam 9.5, upgraded to V11
Script checks for successful backup runs

Code: Select all

$EnabledVbrJobs=(Get-VBRJob | Where-Object -Property IsScheduleEnabled -EQ $True)
foreach ($VbrJob in $EnabledVbrJobs) {
    if ( ($VbrJob.Info.LatestStatus -eq 'Success') -and ($VbrJob.Info.ScheduleOptions.LatestRunLocal -ge $TimeNow.AddHours(-27)) ) 
     .....
}
Get-VBRJob -Name "Job Name" returns 12/31/21 2:09:21AM forLatestRunLocal
But when the POSH script runs it is returning 12/30/21 2:07:38am

Very odd.. Getting the same behavior when checking status on any job.

Thanks!

jay
matteu
Veeam Legend
Posts: 823
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Issue with Get-VBRJob return value LatestRunLocal PS vs interactive

Post by matteu »

Hello,

If it's working with Veeam commandlet, we need to completely see your script to help you :)
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Issue with Get-VBRJob return value LatestRunLocal PS vs interactive

Post by oleg.feoktistov »

Hi Jay,

So with a separate cmdlet it returns one value for LatestRunLocal, and with the whole script - another?
It would be great to have a look at your script then.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests