Using PowerShell, I created a script that other people will be using. Because of this, I am refactoring my code to use more variables. I have a variable named $endcol that will always be equal to the last string placed in another variable, $columnsToExtract. How can I make this work?
Right now my code is:
$columnsToExtract = '30', '31', '39'
$endcol = 39
$columnsToExtract[-1]$columnsToExtract | Select-Object -Last 1Measure-Command { 1..1e6 | Select-Object -Last 1 }toMeasure-Command { (1..1e6)[-1] }