I am wondering if I could get some assistance in figuring out why I am not able to get the start and end times from the backup task. Here is the code block that I think is responsible for this section.
The start and end time columns are not populating with any data.
Can someone please assist me in figuring this out?
Code: Select all
$taskListBk = @()
$taskListBk += $sessListBk | Get-VBRTaskSession
$successTasksBk = @($taskListBk | ?{$_.Status -eq "Success"})
$wfTasksBk = @($taskListBk | ?{$_.Status -match "Warning|Failed"})
$runningTasksBk = @()
$runningTasksBk += $runningSessionsBk | Get-VBRTaskSession | ?{$_.Status -match "Pending|InProgress"}
write-host $runningTasksBk
# Get all Backup Tasks
$bodyAllTasksBk = $null
If ($showAllTasksBk) {
If ($taskListBk.count -gt 0) {
If ($showDetailedBk) {
$bodyAllTasksBk = $taskListBk | Select @{Name="VM Name"; Expression = {$_.Name}},
@{Name="Job Name"; Expression = {$_.JobSess.Name}},
@{Name="Start Time"; Expression = {$_.Progress.StartTime}},
# @{Name="Start Time"; Expression = {"?"}},
@{Name="Stop Time"; Expression = {If ($_.Progress.StopTime -eq "1/1/1900 12:00:00 AM"){"-"} Else {$_.Progress.StopTime}}},
@{Name="Duration (HH:MM:SS)"; Expression = {Get-Duration -ts $_.Progress.Duration}},
@{Name="Avg Speed (MB/s)"; Expression = {[Math]::Round($_.Progress.AvgSpeed/1MB,2)}},
@{Name="Total (GB)"; Expression = {[Math]::Round($_.Progress.ProcessedSize/1GB,2)}},
@{Name="Processed (GB)"; Expression = {[Math]::Round($_.Progress.ProcessedUsedSize/1GB,2)}},
@{Name="Data Read (GB)"; Expression = {[Math]::Round($_.Progress.ReadSize/1GB,2)}},
@{Name="Transferred (GB)"; Expression = {[Math]::Round($_.Progress.TransferedSize/1GB,2)}},
@{Name="Details"; Expression = {($_.GetDetails()).Replace("<br />","$B$R$")}},
Status | Sort "Start Time" | ConvertTo-HTML -Fragment
} Else {
$bodyAllTasksBk = $taskListBk | Select @{Name="VM Name"; Expression = {$_.Name}},
@{Name="Job Name"; Expression = {$_.JobSess.Name}},
@{Name="Start Time"; Expression = {$_.Progress.StartTime}},
@{Name="Stop Time"; Expression = {If ($_.Progress.StopTime -eq "1/1/1900 12:00:00 AM"){"-"} Else {$_.Progress.StopTime}}},
@{Name="Duration (HH:MM:SS)"; Expression = {Get-Duration -ts $_.Progress.Duration}},
@{Name="Details"; Expression = {($_.GetDetails()).Replace("<br />","$B$R$")}},
Status | Sort "Start Time" | ConvertTo-HTML -Fragment
$bodyAllTasksBk = $subHead01 + "Backup Tasks" + $subHead02 + $bodyAllTasksBk
}
}
}