Just tried to get the below script output as excel/csv file . goal is to get all the data in column format
$date = (Get-Date).AddHours(-24)
$sessions = Get-VBRComputerBackupJobSession
foreach ($PBackup_job in (Get-VBRComputerBackupJob | Select Name))
{ $PBackup_job_name = $PBackup_job.Name
write "------------ Physical Server Backup Job Name : $PBackup_job_name ------------"
$sessions | where {$_.CreationTime -ge $date} | sort CreationTime | Select CreationTime, endtime, result, state | Format-Table
} ```
please help to het the desired output
original output [1]: https://i.stack.imgur.com/sKqRq.png
required output [2]: https://i.stack.imgur.com/3hh9B.png