I’m new to PowerShell so this will probably be easy to answer. Suppose I create an array like so:
$array1 = "a", "b", "c"
Then I create another array:
$array2 = $array1|select-object{$_}
What I would like to do is to join all the values in $array2 so I end up with the string “a b c”, but using -join ” ” on $array2 just produces an empty result. Can someone explain to me how I can solve this?
Just replace
$array2 = $array1|select-object{$_}with$array2 = $array1 | select-objector$array2 = $array1