Always welcome good luck.
> new to Powershell, still learning.
Aha, I think it's a good project to cut your teeth on.
>[System.Collections.Generic.List[PSObject]]@()
Just some early tips/advice, don't fret on what this is doing right now, it's just a better way to add items to an array. += works, but it clones the array in memory each time it's called, and for large datasets this can get really slow.
Microsoft's PS documentation is surprisingly well made, so I'd recommend review this about how to create a PSCustomObject, as I suspect you'll want this for your report:
https://learn.microsoft.com/en-us/power ... rshell-7.3
You could edit the ForEach loop to add a line like:
$ReportObject = [PSCustomObject]@{
JobName = $j.Name
ObjectName = $JObjs.Name
}
$ObjectsInJobSummary.Add($ReportObject)
That would add the individual object to that report; keep in mind, $jObjs in my example code will be _an array of the results returned by Get-VBRJobObject_, so you may need an additional loop over the items in $jObjs to make a PSCustomObject for each. Usually nested ForEach/For loops is not recommended, but in this case it shouldn't be too traumatic for your script