I am trying to import and merge columns from 2 CSV file into one using Powershell.
Please look at my code and advise.

I think that it is right, but I am not sure about referencing different columns from one cmdlet.

Import Data needed for Cap Report:

$columbs12 = Import-Csv \10.555.55.555\local\company\SUPPORT\REPOR\CAP - ShotName\Average-Action.csv | select -ExpandProperty UniqueRequests, UniqueUsers    
$columbs3456 = Import-Csv \\10.555.55.555\local\company\SUPPORT\REPOR\CAP - ShotName\Avg-per-Max-d.csv | select -ExpandProperty Percentile80, Percentile95, Percentile99, MaxDuration

Merge Files for Cap Report:

Merge-CSVFiles -CSVFiles $columbs12, $columbs3456 -OutputFile \\10.555.55.555\local\company\SUPPORT\REPOR\CAP - ShotName\CReport.csv

Please advise.

closed as too broad by DavidPostill Dec 20 '18 at 14:22

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • do the CSV files have the same headers in the same order? if so, you can simply use ONE Import-CSV command to import both into the same collection. – Lee_Dailey Dec 20 '18 at 13:11
  • Where does the (unknwon to me) cmdlet Merge-CsvFiles stem from? There are several Join-Csv cmdlets around which usually require a common column and a definition of an inner/outer join etc. – LotPings Dec 20 '18 at 14:19
  • The 2 csv files are each different and have nothing in common. we are merging columns of data. – joe 222 Dec 20 '18 at 14:56