1

Let's say I used Get-ChildItem and get

$list1

Name
----
test1
test2

I want an array of list2

test1.txt
test2.txt

I tried

$list2 = % {$list1.name + ".txt"}

But as for me list2 content is same as list1 ?

user310291
  • 36,946
  • 82
  • 271
  • 487
  • The linked duplicate shows various effective solutions. To fix your attempt: `$list2 = $list1 | % { $_.name + '.txt' }` – mklement0 Nov 21 '21 at 21:19

0 Answers0