I should start by saying I'm no PowerShell expert at all, I can cobble stuff together OK but that's about it.
I have 3 .csv files that all contain 1 column of information.
I need a PowerShell script that will combine each column from the individual CSV files and combine them into a single 3 column CSV file.
i.e.
CSV1
Red
Green
Blue
CSV2
Monday
Tuesday
CSV3
Monkey
Badger
Tiger
Giraffe
And that combined would look like
CSV1 CSV2 CSV3
Red Monday Monkey
Green Tuesday Badger
Blue Tiger
Giraffe
So far I have looked creating an object and adding members, but it seems that each member can only have one value.
$csv1 = Import-Csv "csv1.csv"
$csv2 = Import-Csv "csv2.csv"
$csv3 = Import-Csv "csv3.csv"
$obj = New-Object PSObject
$obj | Add-Member -MemberType NoteProperty -Name "Rule Block 1" -Value $csv1[2] $csv1[3]
$obj | Add-Member -MemberType NoteProperty -Name "Rule Block 2" -Value $csv2[2]
$obj | Add-Member -MemberType NoteProperty -Name "Rule Block 3" -Value $csv3[2]
$obj | Export-Csv "C:\Users\Simon\Desktop\FJ Stuff\Powershell\exportTest.csv" -NoTypeInformation
I'm not even sure if I'm heading in the write direction with this.
Any help here would be greatly appreciated.