How do I create a new variable each time a loop runs?
Something along the lines of
for ($i=1; $i -le 5; $i++) { $\"var + $i\" = $i write-hos
Use New-Variable and Get-Variable (mind available options including scopes). E.g.
New-Variable
Get-Variable
for ($i=1; $i -le 5; $i++) { New-Variable -Name "var$i" -Value $i Get-Variable -Name "var$i" -ValueOnly }