you don’t try to return object and you doesn’t get object
tro to use [PSCustomObject] or New-Object instead of just write-output $somearray
the examples everywhere…
btw, Invoke-Command already return Computername as PSComputerName
Each job that you create using Invoke-Command actually has one child job per computer. There’s a parameter of Show-Job that will let you see the child jobs, in fact. So you can retrieve one “session” (child job) at a time.
The results of each job are whatever your code outputs.