What's the distinction here between $line
and $lines
?
PS /home/nicholas/power_shell> $line = Get-Content ./line.txt
PS /home/nicholas/power_shell> $line
1 2 3
PS /home/nicholas/power_shell> $line[3]
PS /home/nicholas/power_shell> $line[2]
1 2 3
PS /home/nicholas/power_shell> $line.Length
5
PS /home/nicholas/power_shell> $lines = Get-Content ./lines.txt
PS /home/nicholas/power_shell> $lines
1
2
3
PS /home/nicholas/power_shell> $lines.Length
7
PS /home/nicholas/power_shell> $lines[4]
3
PS /home/nicholas/power_shell> $lines[3]
2
PS /home/nicholas/power_shell>
How are the individual numbers in $line
accessed? Specifically, to get the $line[i]
number. That is, the element at the specified index. However, $line
isn't an array in quite the same way as $lines
is.