Thursday, 27 March 2025

Error: Does not contain a method named 'op_Addition'

 


You will get an error while combining/merging two or more [String[]] of arrays which are stored in different variables. 

$variable1 = import-csv "x:\users1.csv"
$variable2 = import-csv "x:\users1.csv"
$variable3 = import-csv "x:\users1.csv"
$finalVariable = $variable1  + $variable12 + $variable13
Error: Does not contain a method named 'op_Addition'


Solution:

$finalVariable = @()

$variable1 = import-csv "x:\users1.csv"

$variable2 = import-csv "x:\users1.csv"

$variable3 = import-csv "x:\users1.csv"

$finalVariable = @($variable1)+@($variable2)+@($variable3)



----------------------------- End -------------------------------------