I am trying to simply rename the column names from an existing CSV and then export the new one.
I do not want all columns. Only specific. All examples I have seen show how to do all, instead of specific columns.
But I am stuck on this error:
Select-Object : Missing an argument for parameter 'Property'. Specify a parameter of type 'System.Object[]' and try again.
Import-Csv "ORIGINALFILEPATHHERE" |
Select-Object -Property
@{name="Dept";expression=$_.'Account'},
@{name="Office";expression=$_.'Location'}|
Export-Csv -Path "EXPORTPATHHERE" -NoTypeInformation -UseCulture -Force