I am trying to add a new column called "REF" to all existing views using powershell which I have succeeded in doing, however when adding the column it is automatically added to the end of the array making it last in the view, I need it to be at the beggining [0]
Can I add the column in at point [0] forcing the other columns to move down the array possibly like this?
$view.ViewFields[0].Add($refField)
Or would I need to copy out the array and re add it in the new order?
$originalArray = $view.ViewFields
$view.ViewFields.Add($refField)
$view.ViewFields.Add($originalArray[0])
$view.ViewFields.Add($originalArray[1])
$view.ViewFields.Add($originalArray[2])
What is the best approach?
Thanks,
Colin.