Hi,
I have the following powershell code
$Headeroutput = @();
for ($x=0; $x -le $Headerinfo.Count-1; $x++)
{
$x
$Headerinfo[$x]."CustomerOrderNumber"
$Headeroutput += $Headerinfo[$x]."CustomerOrderNumber",$Headerinfo[$x]."Type",$Headerinfo[$x]."one",$Headerinfo[$x]."two",$Headerinfo[$x]."three",$Headerinfo[$x]."four",$Headerinfo[$x]."Status",$Headerinfo[$x]."five",$Headerinfo[$x]."six",$Headerinfo[$x]."seven",$Headerinfo[$x]."eight",$Headerinfo[$x]."customer_account",$Headerinfo[$x]."nine",$Headerinfo[$x]."ten",$heHeaderinfoader[$x]."eleven"
$result += $Headeroutput -join ","
I am getting the error
Line |
99 | $Headeroutput += $Headerinfo[$x]."CustomerOrderNumber",$Head …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot index into a null array.
I am not really understanding as I am initialising the array.
Any help appreciated.