I have 2 csv files as like below
First.csv
Header1,Header2
abc,xyz
2nd.csv
Header1
abc
The output I expect is as below
Header1,Header2, Header3
abc,xyz,Comment
I am trying to use the below script but not just able to put it in place.
$CSV1 = C:\Path\To\File1.csv
$CSV2 = C:\Path\To\File2.csv
$CSV1|ForEach{$|Add-Member ‘Name ID’ $Null}
ForEach($Record in $CSV1){
$Record.‘Name ID’ = $CSV2|Where{$.ID -eq $Record.ID}|Select -Expand ‘Name ID’
}