I want to add some data into one array variable in PowerShell. but it is showing error like "Index was outside the bounds of the array". What I have is:
$test = @()
for ($i = 0 ; $i -lt 20; $i++)
{
$test[$i] = $i
}
$test
And it is showing error that "Index was outside the bounds of the array".
Is there any way in PowerShell to store the data into an array variable.