powershell arry initialize add

C++
$al = New-Object System.Collections.ArrayList
for($i=0; $i -lt 5; $i++)
{
    $al.Add($i)
}
Source

Also in C++: