MaYaN
MaYaN

Reputation: 6986

How can I join the result of Get-ChildItem by a given character in PowerShell?

I recently asked a question on how to join the result of ls which I tried to use for the result returned by Get-ChildItem but to no luck.

The command I am trying to join the result of (by let's say -) is:

Get-ChildItem -Path . -Filter bin -Recurse | where {$_.psiscontainer} | gci -Filter *test*.dll -Recurse | select {$_.FullName}

Any help is much appreciated.

Upvotes: 0

Views: 1355

Answers (1)

arco444
arco444

Reputation: 22821

You need to expand the FullName property so you can join strings instead of objects:

(Get-ChildItem -Path . -Filter bin -Recurse | where {$_.psiscontainer} | gci -Filter *test*.dll -Recurse | select -ExpandProperty FullName) -join ' - '

Upvotes: 3

Related Questions