r/PowerShell • u/EquivalentBear1513 • Jun 14 '26
Question Powershell shortcut
Does powershell have shorter syntax equivalent to this
```
touch intl_{en,ar,fr,sw}.arb
```
0
Upvotes
r/PowerShell • u/EquivalentBear1513 • Jun 14 '26
Does powershell have shorter syntax equivalent to this
```
touch intl_{en,ar,fr,sw}.arb
```
4
u/lan-shark Jun 14 '26 edited Jun 14 '26
That is a feature in many shells called brace expansion, PowerShell does not have this feature. Generally speaking, the language accepts verbosity as a tradeoff for clarity, though there are some syntax shortcuts. I think the shortest way to do the equivalent would be
2
u/LogMonkey0 Jun 14 '26
In shell (like Bash), brace expansion is a string-generation shortcut used to create multiple arguments before the command runs (e.g., mkdir dir_{1..3}becomes mkdir dir_1 dir_2 dir_3). PowerShell does not have a native brace expansion feature. [1, 2, 3, 4, 5]
Instead, PowerShell relies on subexpressions ($()) and array range operators (..) to produce the same results programmatically.
-1
u/BlackV Jun 14 '26
Why?, why? would you want something like that