I am trying to join together two csv's. One of the CSVs contain the column I want to add to the other but when the csv is exported the column added is blank.
$csv1
VLAN
1
2
3
$csv2
Host
NETMAN
ADMIN
CLIENT
I get
VLAN, Host
1,
2,
3,
Desired output is
VLAN, Host
1,NETMAN
2,ADMIN
3,CLIENT
I tried
$csv1 = Import-Csv -Path ".\VLAN.csv"
$csv2 = Import-Csv -Path ".\Hostname.csv"
$csv1 | % {$i=0} { $csv1[$i] | Add-Member -NotePropertyName Hostname -NotePropertyValue $csv2[$i++].Hostname;}
$csv1 | Export-Csv combined.csv -NoType