I found this impressive script:
https://blog.smasterson.com/2017/12/22/ ... ort-9-5-3/
With the relevant code here:
Code: Select all
$arrAllSessTp = $sessListTp | Sort Creationtime | Select @{Name="Job Name"; Expression = {$_.Name}},
@{Name="State"; Expression = {$_.State}},
@{Name="Start Time"; Expression = {$_.CreationTime}},
@{Name="Stop Time"; Expression = {If ($_.EndTime -eq "1/1/1900 12:00:00 AM"){"-"} Else {$_.EndTime}}},
@{Name="Duration (HH:MM:SS)"; Expression = {Get-Duration -ts $_.Progress.Duration}},
@{Name="Avg Speed (MB/s)"; Expression = {[Math]::Round($_.Info.Progress.AvgSpeed/1MB,2)}},
@{Name="Total (GB)"; Expression = {[Math]::Round($_.Info.Progress.ProcessedSize/1GB,2)}},
@{Name="Data Read (GB)"; Expression = {[Math]::Round($_.Info.Progress.ReadSize/1GB,2)}},
@{Name="Transferred (GB)"; Expression = {[Math]::Round($_.Info.Progress.TransferedSize/1GB,2)}},
@{Name="Details"; Expression = {($_.GetDetails()).Replace("<br />","ZZbrZZ")}}, Result
$bodyAllSessTp = $arrAllSessTp | ConvertTo-HTML -Fragment
If ($arrAllSessTp.Result -match "Failed") {
$allSessTpHead = $subHead01err
} ElseIf ($arrAllSessTp.Result -match "Warning" -or $arrAllSessTp.State -match "WaitingTape") {
$allSessTpHead = $subHead01war
} ElseIf ($arrAllSessTp.Result -match "Success") {
$allSessTpHead = $subHead01suc
} Else {
$allSessTpHead = $subHead01
}
$bodyAllSessTp = $allSessTpHead + "Tape Backup Sessions" + $subHead02 + $bodyAllSessTp
If I read this correctly, I should be able to get the information I want, by
Code: Select all
PS C:\Windows\system32> $tapeSessions | sort creationTime | select @{Name="Job Name"; Expression = {$_.Name}}, @{Name="Total "; Expression = {$_.Info.Progress.ProcessedSize}}, @{Name="Transferred "; Expression = {$_.Info.Progress.TransferedSize}}
But, the result is:
Code: Select all
Job Name Total Transferred
-------- ------ ------------
Full backup to tape
Full backup to tape
When I look at a single session, it doesn't have a Info property. Could this be because no data was transferred? Also, there is a spelling error in the word 'Transfered', but that seems to be on purpose, since the property in VEEAM has a spelling error as well.