I'm looking for a concise PowerShell equivalent to the shell command `touch intl_{en,ar,fr,sw}.arb`, which creates four empty files: `intl_en.arb`, `intl_ar.arb`, `intl_fr.arb`, and `intl_sw.arb`. Does PowerShell support brace expansion, or is there a short idiomatic way to generate these filenames and create the files?
3 Answers
PowerShell doesn’t have native brace expansion like Bash. The straightforward equivalent is to pipe the language codes into `ForEach-Object` and create each file: `'en','ar','fr','sw' | ForEach-Object { New-Item "intl_$_.arb" }`. `ForEach-Object` is commonly shortened to `%`, and `New-Item` can also be abbreviated as `ni`.
For a very compact version, you could write `-split 'en ar fr sw' | % { ni "intl_$_.arb" }`. It works, but the more explicit `ForEach-Object` and `New-Item` names are usually easier to read and maintain.
The key difference is that Bash performs brace expansion before running the command, while PowerShell generally generates the values programmatically. For a small fixed list, an array plus a pipeline is the clearest approach; there isn’t a built-in `{en,ar,fr,sw}` shorthand.

You can also use PowerShell’s delay-binding script blocks to avoid an explicit `ForEach-Object`: `'en','ar','fr','sw' | New-Item -Path { "intl_$_.arb" } -Value ''`. The empty `-Value` prevents the piped language code from being written into the files.