Is there cunning way to use powershell output a list/table of protected VMs which shows:
VMname Backup Job Backup Repository Copy Job Copy Repository
Bonus points for includeing the date of the most recent recovery point in backup and copy
I'm able to list VMname and Backup Job, but can't figure out how to extend it...
Code: Select all
$vm_jobs = Get-VBRJob -WarningAction SilentlyContinue | ?{$_.JobType -eq "Backup"}
$report = foreach ($job in $vm_jobs){
$job_object = Get-VBRJobObject -Job $job.Name
foreach ($object in $job_object){
[PSCustomobject]@{
VMName = $object.Name
Job = $job.Name
}
}
}