Currently doing:
Code: Select all
$SessionList = Get-CachedSessions | Where-Object {$_.JobID -eq $Job.ID -and $_.result -ne "None"} | Sort-Object creationtime -Descending
ForEach($Sess in $SessionList){
if($lastMerge -eq $null){
$lastMerge = (($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Status -eq "ESucceeded" -and $_.Title -match "^Full backup file merge completed successfully"}).UpdateTime)
$dataMerge = ($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Status -eq "ESucceeded" -and $_.Title -match "^Full backup file merge completed successfully"})
}
if($lastCompact -eq $null){
$lastCompact = (($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Status -eq "ESucceeded" -and $_.Title -match "^Full backup file compact completed successfully"}).UpdateTime)
$dataCompact = ($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Status -eq "ESucceeded" -and $_.Title -match "^Full backup file compact completed successfully"})
}
if ($lastHeathCheck -eq $null){
if(!($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Title -match "^Failed to perform backup file verification"})){
$lastHeathCheck = (($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Status -eq "ESucceeded" -and $_.Title -match "^Backup files health check has been completed"}).UpdateTime)
$dataHeathCheck = ($Sess.Logger.GetLog().UpdatedRecords | where-Object {$_.Status -eq "ESucceeded" -and $_.Title -match "^Backup files health check has been completed"})
}
}
if(($lastMerge -ne $null) -and ($lastCompact -ne $null) -and ($lastHeathCheck -ne $null)){
break
}
}