How to join array in pipe
You could try this :
@(type .\bleh.log | where { $_ -match "foo"} | select -uniq) -join ","
You would need a Foreach-Object
(alias %
) after the last pipe to have the $_
variable available but it wouldn't help since it holds a single cell value (for each loop iteration).