Don’t do that: The following code requires multiple lines to create variables (with the same prefix “number”):
$number1 = 0
$number2 = 0
$number3 = 0
$number4 = 0
$number5 = 0
Do that: It’s possible to create multiple variables in one line and initialize them with a specific value, 0 for example:
1..5 | ForEach-Object -Process {New-Variable -Name "number$_" -Value 0}