So I'm tweaking some Powershell libraries and I've a simple question that I'd like to solve in the best way.....
In short, I've some custom PSObjects in an array:
$m1 = New-Object PSObject –Property @{Option="1"; Title="m1"}
$m2 = New-Object PSObject –Property @{Option="2"; Title="m2"}
$m3 = New-Object PSObject –Property @{Option="3"; Title="m3"}
$ms = $m1,$m2,$m3
that I wish to convert into a string array.... ideally a single string array which has an entry for each item with the properties concatenated. i.e.
"1m1", "2m2", "3m3"
I've tried $topMenu | Select-Object Option,Title
and $topMenu | %{ "O: $_.Option T: $_.Title "}
but they give me arrays of the PSObject (again) or arrays of arrays.