I'm trying to create a monthly report and I've run into a stumbling block.
Setup; each month I get an exported .csv from a security appliance and it has a lengthy csv file.
On the header line I've got 2 cells that are very similar "DestinationLogonID" and "DestinationLogonid". As you can see the "only" difference is the case of the last 2 characters.
import-csv won't work as it sees these 2 header items as identical.
Now the good part is I don't need either of these columns as they are blank so either renaming one of them or deleting one or both columns are an option.
Using the -header option isn't really an option as there are about 147 columns.
My preferred method would be to rename one of the offending column headers.
I can read the file using the Get-Content and that "seems" to be the way to get the data into an array but that's where I'm stuck.
Here's where I'd like to go with this script;
-> Read input file and in this process rename offending header
-> Process specific columns into my report.
-> Write output file for report.
At this point I only need help with the first step as the others are more or less canned scripts that I've already created.