In bash I wrote
echo prefix{t1,t2,t3}suffix
and got
prefixt1suffix prefixt2suffix prefixt3suffix
Is something like this present in PowerShell? List expantion I mean.
There is no automatic expansion, but you can do it easily with ForEach-Object cmdlet or array's ForEach method in PS 4 and higher:
't1', 't2', 't3' | ForEach-Object {'prefix' + $_ + 'suffix'}
@('t1', 't2', 't3').ForEach({'prefix' + $_ + 'suffix'})
vim -d /some/directory/file{1,2}.ps1 with that I have write in PowerShell and you'll see my reason.A couple of other ways are:
't1', 't2', 't3' | % {"prefix$($_)suffix"}
and
't1', 't2', 't3' | % {'prefix{0}suffix' -f $_}
"t1","t2","t3" | % { "prefix" + $_ }