I'm running an exe from invoke-command on multiple servers and it works. I get a string array with all the output I expect.
$result = invoke-command $servers { & "\path\toexe" arg1 }
This gives me the correct results
str3 str4 str2
...and the PSCOMPUTER name is in there too, but I can't show them together so I can't match the result to the PSComputername all at once.
$Result|GM just shows me PScomputername and RunspaceID as properties. It's like the $result array has no label for the string.
$result | Select * doesn't show me the string
$Result.gettype() shows it is [object] System.Array
I can do $result[0] will show me str3
And then $result[0].PSComputername will show Server3
How do I get that whole array on the screen or dumped to csv together? I'd like to see
PSCOMPUTERNAME ?? Server3 str3 Server2 str2